Created
October 1, 2013 00:21
-
-
Save pjb3/6772258 to your computer and use it in GitHub Desktop.
Rails 4 appears to log SQL queries in the console in development by default. If it doesn't, I can't figure out why it is for me.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat ~/.irbrc | |
cat: /Users/pbarry/.irbrc: No such file or directory | |
$ rails c | |
Loading development environment (Rails 4.0.0) | |
irb(main):001:0> Subscription.first | |
Subscription Load (2.5ms) SELECT "subscriptions".* FROM "subscriptions" ORDER BY "subscriptions"."id" ASC LIMIT 1 | |
=> nil | |
irb(main):002:0> puts ENV.keys.sort | |
Apple_PubSub_Socket_Render | |
Apple_Ubiquity_Message | |
BUNDLE_BIN_PATH | |
BUNDLE_GEMFILE | |
COLORFGBG | |
COMMAND_MODE | |
EDITOR | |
GEM_HOME | |
GEM_PATH | |
HOME | |
ITERM_PROFILE | |
ITERM_SESSION_ID | |
LANG | |
LESS | |
LOGNAME | |
PATH | |
PROMPT_COMMAND | |
PWD | |
RBENV_DIR | |
RBENV_HOOK_PATH | |
RBENV_ROOT | |
RBENV_VERSION | |
RUBYOPT | |
SECURITYSESSIONID | |
SHELL | |
SHLVL | |
SSH_AUTH_SOCK | |
TERM | |
TERM_PROGRAM | |
TMPDIR | |
USER | |
VISUAL | |
__CF_USER_TEXT_ENCODING | |
=> nil | |
irb(main):003:0> ActiveRecord::Base.logger | |
=> #<ActiveSupport::Logger:0x007fef54e4d310 @progname=nil, @level=0, @default_formatter=#<Logger::Formatter:0x007fef54e4d2c0 @datetime_format=nil>, @formatter=#<ActiveSupport::Logger::SimpleFormatter:0x007fef54ca9b58 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x007fef54e4d270 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<File:/Users/pbarry/dev/... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment