Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the best way to make sure a ruby on rails log file doesn't get too large and how would you back them up on Amazon S3?

I know ec2onrails has this build in to the AMI but I'm not sure how to implement it on another machine. Thx

share|improve this question

Your Ruby on Rails log files should be automatically rotated like any other log file (the tool to do this varies from system to system -- it's usually logrotate on Linux & newsyslog on BSD systems. Ideally you're sending these logs through the syslog daemon, otherwise you need to make sure that you notify the process writing to the log file that you've rotated it (or the process may keep trying to write to the old log).

Re: backing up the log files, normally you would keep a week (or a month if you feel generous) worth of them locally, and then let them go away -- for troubleshooting you really only need the current log plus a few old ones for comparison. If you need to keep them around for auditing purposes yo can use the backup system of your choice to grab the rotated logs (usually logfile.0, logfile.1, etc.). A simple system can also be cobbled together using rsync (see man rsync for more details).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.