Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.