CentOSでの例。
Rails
/etc/logrotate.d/rails
/path-to-app/log/*.log {
weekly
rotate 15
missingok
notifempty
copytruncate
dateext
compress
create 0666 username username
lastaction
pid=/path-to-app/tmp/pids/unicorn.pid
test -s $pid && kill -USR1 "$(cat $pid)"
endscript
}
nginx
/etc/logrotate.d/nginx
/var/log/nginx/*log {
create 0644 nginx nginx
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/etc/init.d/nginx reopen_logs
endscript
}
NewRelic
/etc/logrotate.d/newrelic-sysmond
/var/log/newrelic/nrsysmond.log {
rotate 7
daily
missingok
notifempty
sharedscripts
copytruncate
compress
}