Last Updated: February 25, 2016
·
317
· chadoh

Show SQL statements in log in Rails 2.3

Working in an old project and need to see the SQL statements in your logs? Run this as soon as you're in a console, before you run anything else:

ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)