Less verbose Rails logging

Sometimes I wonder why it took me so long to do something so simple. Today I toned down the logging on many live Rails applications.

By default this is set to ‘info’ which logs every request quite verbosely. This leads to huge logfiles! This is much better suited for a production environment:

# Be less verbose in logging and use a logfile named after the Ruby process owner.
config.log_level = :warn
config.log_path = Rails.root.join('log', "#{`id -un`.chomp}.log"

About joost

Senior Ruby on Rails web developer, with a focus on content and media management. I have built, and continue to maintain, some of the busiest sites in The Netherlands. I strongly advocate a pleasant and concise user experience, agile development, web standards and open source software.