Discussion:
[Supervisor-users] Log rotation
Yury Sobolev
2014-12-04 20:59:18 UTC
Permalink
Hi,

I am trying to get supervisor to rotate logs daily. There does not appear
to be an option to do so. I could run logrotate, but I am not sure how well
that would work. I would like log files to be unlimited in size, but split
by day. If logrotate rotates the log, supervisor will still have its
descriptor pointing at the old file. Can I force supervisor to reopen a
log? Or, is there a more elegant solution?

-Yury
Sky Lothar
2014-12-16 13:18:09 UTC
Permalink
try this

#!/bin/bash
cp xxx.log
truncate --size=0 xxx.log
Post by Yury Sobolev
Hi,
I am trying to get supervisor to rotate logs daily. There does not appear
to be an option to do so. I could run logrotate, but I am not sure how well
that would work. I would like log files to be unlimited in size, but split
by day. If logrotate rotates the log, supervisor will still have its
descriptor pointing at the old file. Can I force supervisor to reopen a
log? Or, is there a more elegant solution?
-Yury
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Andres Reyes Monge
2014-12-16 13:22:29 UTC
Permalink
Looking at the documentation seems like you could use the SIGUSR2 signal

*supervisord* will close and reopen the main activity log and all child log
files.

http://supervisord.org/running.html#signal-handlers
Post by Sky Lothar
try this
#!/bin/bash
cp xxx.log
truncate --size=0 xxx.log
Post by Yury Sobolev
Hi,
I am trying to get supervisor to rotate logs daily. There does not appear
to be an option to do so. I could run logrotate, but I am not sure how well
that would work. I would like log files to be unlimited in size, but split
by day. If logrotate rotates the log, supervisor will still have its
descriptor pointing at the old file. Can I force supervisor to reopen a
log? Or, is there a more elegant solution?
-Yury
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Continue reading on narkive:
Loading...