Created
July 24, 2018 03:47
-
-
Save namnv609/32e7d2f886ab873bba467f4062cba368 to your computer and use it in GitHub Desktop.
Logrotate configuration for Puma and Sidekiq
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/log/folder/*.log { | |
su deployer deployer | |
daily | |
rotate 7 | |
missingok | |
dateext | |
compress | |
notifempty | |
olddir /path/to/old/folder | |
sharedscripts | |
postrotate | |
[ -e /path/to/puma/puma.pid ] && kill -HUP `cat /path/to/puma/puma.pid` && kill -USR1 `cat /path/to/puma/puma.pid` && [ -e /path/to/sidekiq/sidekiq-0.pid ] && kill -USR2 `cat /path/to/sidekiq/sidekiq-0.pid` | |
endscript | |
} | |
# Puma signals: | |
# -HUP: Reopen puma.*.log | |
# -USR1: Reopen <application>.log | |
# Sidekiq signal: | |
# -USR2: Reopen sidekiq log file(s) | |
# For multiple sidekiq indexes | |
# `cat /path/to/sidekiq/sidekiq-*.pid | xargs kill -USR2` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment