Skip to content

Instantly share code, notes, and snippets.

@rrrodrigo
Created September 23, 2010 13:51
Show Gist options
  • Save rrrodrigo/593634 to your computer and use it in GitHub Desktop.
Save rrrodrigo/593634 to your computer and use it in GitHub Desktop.
Rails production.log rolling using the standard Linux logrotate mechanism
# put this into /etc/logrotate.d/app-production
# to have a Rails app running on unicorns rotating/rolling its logs monthly
# check with logrotate -f /etc/logrotate.d/app-production
/web/app/production/shared/log/*.log {
monthly
missingok
rotate 24
compress
delaycompress
sharedscripts
postrotate
kill -s HUP `cat /web/app/production/shared/pids/unicorn.pid`
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment