Skip to content

Instantly share code, notes, and snippets.

@jwilsjustin
Created September 4, 2015 13:19
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 jwilsjustin/c3e1e84ffffb6715cc44 to your computer and use it in GitHub Desktop.
Save jwilsjustin/c3e1e84ffffb6715cc44 to your computer and use it in GitHub Desktop.
The best way I've found to log SQL in Rails 4.x+ applications
# Log SQL queries to STDOUT
unless Rails.env.test?
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment