Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

waikup83
Copy link

@waikup83 waikup83 commented May 1, 2019

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

called by kill -USR1 PID
@waikup83 waikup83 changed the title for log rotation with logrotate.d issues #116 - log rotation with logrotate.d May 1, 2019
Copy link
Member

@carltongibson carltongibson left a 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?

@waikup83
Copy link
Author

waikup83 commented Jul 3, 2019

Its hard to test the behaviour of logrotate.d ... no?

@carltongibson
Copy link
Member

Surely we can send the signal and check that the the handler works correctly (i.e that the log files are correctly swapped)?

@waikup83
Copy link
Author

waikup83 commented Jul 10, 2019

maybe … but now i have not sush time to check how test are allready integrated and do one :/ … maybe later

@waikup83
Copy link
Author

So you want a test.py to test if newly file is created ?!

@carltongibson
Copy link
Member

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!!!

@waikup83
Copy link
Author

you will add a test or i have to add a test?

Base automatically changed from master to main March 3, 2021 18:20
@carltongibson
Copy link
Member

Discussion in #116 leans to not adding this directly in Daphne (but moving to use Python's logging framework as an orthogonal improvement). Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants