Created
April 6, 2015 02:15
-
-
Save goodfeel/a6b0f7345f0f082c857a to your computer and use it in GitHub Desktop.
Logrotate - Chef Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /var/log | |
sudo mkdir rails | |
sudo chown ec2-user:ec2-user rails | |
# /etc/logroate.conf | |
# Rotate weekly and when reached 52 rotations, notify or remove | |
# compress to .gz with delaycompress (compress will be done on next round of logrotation) | |
# ignore size 0 file | |
# copytruncate so we don't need to restart unicorn. | |
/var/www/XXX/shared/log/*.log { | |
weekly | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
olddir=/var/log/rails/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment