Rotating Logs on OS X
I have a couple of rails sites running on an Xserve at work. There are ways to rotate rails logs using Logger. While it would be nice to just let rails take care of it, it seems that that technique will fail when you’re running a cluster of mongrels. Those puppies write to the same log, so if you pull it out from under them it will surely result in dreaded 500 errors. That’s embarrassing.
Mongrel FAQ advises us to use something like logrotate. That’s a Debian package and it does not come with OS X. I spent way too much time looking for a binary to use. If you’re not a sysadmin this dark art of rotating logs can be deucedly tricky to nail down. In the end, MacPorts to the rescue (again). I <heart> MacPorts. BONUS: I can use it to rotate my Apache logs too.
Trackbacks
Use this link to trackback from your own site.
hey there,
i found that there is a new utility on mac osx leopard to rotate logs.
it is configured here
/etc/newsyslog.conf
and the manual is here.
man newsyslog.conf
you can specify any custom log files to rotate, e.g. php error_log