How can you hide database output in Rails console?

In newer version of Rails, I'm guessing from 3 up, database queries are output to the console. This is useful most of the time, but how can you hide it when you do not want to see it?


A better way of doing this is by typing this into the console:

ActiveRecord::Base.logger.level = 1 

as it prevents problems trying use a pointer to a logger that is set to nil (source: Disable Rails SQL logging in console)

To turn it back on

ActiveRecord::Base.logger.level = 0

ActiveRecord::Base.logger = nil

from here


Short answer... In the file development.rb change or add the value of config.log_level so that there's a line like

config.log_level = :info

From a friend of mine:

your_query; nil