Created
December 5, 2017 11:09
-
-
Save krisleech/f97ce3aae3ebebce810bc811e57bb159 to your computer and use it in GitHub Desktop.
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
``` | |
{{ deploy_to }}/shared/log/*.log { | |
missingok | |
compress | |
delaycompress | |
weekly | |
rotate 128 | |
copytruncate | |
create 660 {{ deploy_user }} {{ deploy_user }} | |
} | |
``` | |
`compress` with `delaycompress` will keep last log file uncompressed until next rotation, so you will have production.log (current log) and production.log.1 (last log) and production.log.2.gzip. | |
`copytruncate` truncate existing log instead of copying, meaning any apps which are using log can continue to do so without opening a new log file. | |
`weekly` and `rotate 128` will keep ~2 years worth of logs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment