Disabling SQL logging in rails development


You are working on a new feature that outputs a lot of SQL code in your log file so it’s difficult to see what else is happening, and you would like to disable the SQL logging in your development environment temporarily.


You can add the following to your config/application.rb file:

if Rails.env.development?
  ActiveRecord::Base.logger = Logger.new('/dev/null')

Thanks to the solution here