rotate those rails logs

Posted by scottk on March 12, 2008 in Ruby on Rails, Sysadmin |

Ruby on RailsAs we come closer to going live with a high traffic Rails apps it’s time to hammer out log rotation. Thus far I’ve established a standard deployment location of /usr/local/sites/sitename for our apps. Following this advice I think I’ll use standard logrotate to move the logs around. I’ve read that log rotation can be done within Rails itself, but I’m rather afraid of Rails bloat at this point already and one less thing for the framework to worry about the better. Additionally as an admin if logging parameters aren’t meeting my needs having to go into the Rails app and redeploy it to make a change is just a bad idea. To that end I’ve come up with the following logrotate conf file which I’m dropping into /etc/logrotate.d/ as a file named rails:


# Rotate Rails application logs
/usr/local/sites/*/shared/log/*.log {
daily
missingok
compress
delaycompress
notifempty
copytruncate
dateext
}

I’m not deleting out old logs by default at this point but will add this once we’ve been up and rotating and backing up logs for a decent amount of time.

Copyright © 2006-2024 SimpIT.com All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.