Rotating Logs for Rails on Passenger (Mac)Posted: August 5, 2013
Like many Linux utilities not included on Mac OS X, Homebrew can provide logrotate to more effectively manage large log files. Setup:
brew install logrotate
- Once installation is complete, create a configuration file for logrotate. I chose to use the same configuration defined here: http://overstimulate.com/articles/logrotate-rails-passenger and named the file “logrotate.conf”.
- We can now kick logrotate in to gear:
/usr/loca/sbin/logrotate -f -s logrotate.status logrotate.conf
Note that in the above, I defined explicitly where to stick the logrotate status file so that it is owned by the current user and not reliant on sudo, etc.