Squelch Your Noisy Rails Logs

Hey there!

Here’s a quick and easy way to make your Rails logs a lot quieter and more easy to look at. In application.rb, add the following to the bottom:

ActiveRecord::Base.logger = Logger.new("/dev/null")

This will turn off all the SQL query logging, which I have always found to make the logs too noisy, and I’ve never once found to actually be useful in tracking down a problem.

Of course, if you ever need to see those logs again, it’s as simple as removing that line.

Happy Hacking!