adding rails log rotation to dreamhost
Posted: May 21st, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: dreamhost, logrotate, rails, ruby | 3 Comments »While Dreamhost may rotate the apache logs for you there is nothing automatic to rotate the rails production logs. This may not be an issue since you have “unlimited” disk space but it’s a good idea anyway.
You need to install logrotate since it doesn’t exist by default on the server and then place it in a location where it can be run. You also need to create the configuration file and status files. Once that is set up, you can install a cron job via the Dreamhost panel.
Now it should be rotating your application logs nightly. You can add more sites to the conf file as needed.
I’ve been trying to get this to work today, but I can’t seem to compile the files. It complains that I don’t have the include file popt.h. Is there another package I need to install/build before logrotate to get this to work?
I struggled with this too until I figured out how to get the popt library compiled. Here’s my fork of the instructions: http://digitalcardboard.com/blog/2010/11/04/adding-rails-log-rotation-to-dreamhost-compiling-logrotate/
[...] goes to Joey Geiger for the original [...]