It looks like there are two accepted ways of rotating log files on
production, but most of the discussion I've found is a couple years
old. Does anyone have an opinion on which of these methods is better
for a Rails 3 app on CentOS? Which method are you using and what are
the drawbacks of it?

1) Inside of Rails:

In config/environments/production.rb, put in something like this line:

config.logger = Logger.new(config.log_path, 50, 1.megabyte)

2) Using logrotate:

create the file /etc/logrotate.d/passenger and put something like this in it:

/home/deploy/app/shared/log/*.log {
  daily
  missingok
  rotate 30
  compress
  delaycompress
  sharedscripts
  postrotate
    touch /home/deploy/app/current/tmp/restart.txt
  endscript
}

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to