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"