Peter Marklund's Home |
Really Simple Rails Log Rotatation
I always used logrotate Linux tool to setup log rotation for my Rails apps which has worked fine although it required finding some external config file and understanding its config options and syntax. I never new log rotation could be set up by adding this one line to config/environments/production.rb right in your app:
config.logger = Logger.new(config.log_path, 50, 1.megabyte)
Sweet!