Last active
December 23, 2023 10:00
-
-
Save rrei/bac8aec1637a26079604b6de9710b1bf to your computer and use it in GitHub Desktop.
logrotate configuration with copyrotate for multiprocess app logging (https://medium.com/@rui.jorge.rei/semi-correct-handling-of-log-rotation-in-multiprocess-python-applications-75c56eca6780)
This file contains hidden or 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
/path/to/logs/*.log { | |
# Effective uid/gid used when running this pattern | |
# NOTE: this **is not** the same as the owner user and group of the rotated files | |
su root root | |
# Rotate once every day | |
daily | |
# Keep a history of 5 rotations | |
rotate 5 | |
# Rotate even if the log file is empty | |
ifempty | |
# Skip this block without error if no files match the pattern | |
missingok | |
# Copy and truncate the original log file | |
copytruncate | |
# Compress rotated logs | |
compress | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment