Last active
August 29, 2015 14:07
-
-
Save bplaxco/f3cc36b8c016e6fc8fb0 to your computer and use it in GitHub Desktop.
Example log rotation file to put in `/etc/logrotate.d/`
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
/var/log/<app_name>/*.log { | |
daily # Rotate Daily. | |
rotate 30 # Keep Last 30 Logs. | |
missingok # If file is missing, go on to the next one without issuing an error message. | |
copytruncate # Truncate the original log file in place after creating a copy. | |
compress # Old versions of log files are compressed with gzip(1) by default. | |
delaycompress # Postpone compression of the previous log file to the next rotation cycle. | |
notifempty # Do not rotate the log if it is empty. | |
olddir /var/log/<app_name>/history # Logs are moved into directory for rotation. | |
dateext # Archive old versions of log files adding a daily extension. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment