[Supervisor-users] Log rotation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Supervisor-users] Log rotation

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
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Log rotation

Sky Lothar
try this?

#!/bin/bash
cp xxx.log
truncate --size=0 xxx.log

On 2014年12月5日周五 上午4:59 Yury Sobolev <[hidden email]> wrote:
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
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users

_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Log rotation

Andres Reyes
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.

On Tue Dec 16 2014 at 7:18:15 AM Sky Lothar <[hidden email]> wrote:
try this?

#!/bin/bash
cp xxx.log
truncate --size=0 xxx.log

On 2014年12月5日周五 上午4:59 Yury Sobolev <[hidden email]> wrote:
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
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users

_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users