-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues #116 - log rotation with logrotate.d #260
Conversation
called by kill -USR1 PID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance of adding tests for this behaviour?
Its hard to test the behaviour of logrotate.d ... no? |
Surely we can send the signal and check that the the handler works correctly (i.e that the log files are correctly swapped)? |
maybe … but now i have not sush time to check how test are allready integrated and do one :/ … maybe later |
So you want a test.py to test if newly file is created ?! |
Hi @waikup83. I'm working on a set of releases here for September, so I'll give this a run before then, and add a test for the signal handler. Thank you for the input!!! |
you will add a test or i have to add a test? |
Discussion in #116 leans to not adding this directly in Daphne (but moving to use Python's logging framework as an orthogonal improvement). Thanks |
For implentation exemple
File in /etc/logrotate.d/daphne
/directory/of/log/daphne.log {
su root root
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
postrotate
ps aux | grep -v grep | grep '/directory/running/daphne' | awk '{system("kill -USR1 "$2)}'
endscript
}
test : logrotate -f daphne