Customize Rails' Log Rotation

technicalpickles edited this page Nov 21, 2012 · 2 revisions

Moonshine provides logrotate for your application's log directory automatically. Sometimes you may need to keep them longer, for whatever reason.

Most common is to change the options. Here's an example you can add to your config/moonshine.yml:

    - daily
    - missingok
    - compress
    - delaycompress
    - sharedscripts

Or to your application_manifest.rb:

# make sure this is before recipe :default_stack
configure :rails_logrotate => {:options =>  %w(daily missingok compress delaycompress sharedscripts)}

These are actually the defaults. Check out the man page for all the logrotate options.