logrotate and mongrel (mongrel_cluster)
I've never actually explored log rotation tools in Linux and merely knew of the existence of logrotate and left it at that until log sizes really became a problem. Turns out logrotate is amazingly easy to configure, and thanks to this Logrotate and Mongrel blog post by Corey Donohoe I have it setup for my Rails applications that are running on Mongrel. Here's what my /etc/logrotate.d/mongrel_cluster looks like:
/var/railsapps/APP_NAME/shared/log/production.log {
daily
rotate 28
missingok
compress
sharedscripts
postrotate
for i in `ls /var/railsapps/APP_NAME/shared/log/*.pid`; do
kill -USR2 `cat $i`
done
endscript
}