Skip to content

Instantly share code, notes, and snippets.

@marcgg
Created August 18, 2011 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcgg/1153638 to your computer and use it in GitHub Desktop.
Save marcgg/1153638 to your computer and use it in GitHub Desktop.
Display SQL log to the Rails console in 2.x
require 'logger'
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
# log SQL to the Rails console
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
end
@marcgg
Copy link
Author

marcgg commented Aug 18, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment