adding rails log rotation to dreamhost

Posted: May 21st, 2010 | Author: | Filed under: ruby, web | Tags: , , , | 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.


3 Comments on “adding rails log rotation to dreamhost”

  1. 1 Cam Ferroni said at 7:21 pm on June 27th, 2010:

    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?

  2. 2 Jason Navarrete said at 12:06 pm on November 4th, 2010:

    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/

  3. 3 Adding Rails log rotation to Dreamhost (compiling your own logrotate) said at 6:37 pm on January 19th, 2011:

    [...] goes to Joey Geiger for the original [...]


Leave a Reply