[Supervisor-users] Supervisord keeping logs of only last 7 days

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

[Supervisor-users] Supervisord keeping logs of only last 7 days

Divick Kishore
Hi,
     I am seeing strange behavior with supervisord logging. I see that
the logs are only maintained for last 7 days and the logs are not
being rotated based on file size. This is the configuration that I
have for supervisord:

[supervisord]
logfile=/myhome-dir/logs/user/supervisord.log ; (main log file
               ; default $CWD/supervisord.log)
logfile_maxbytes=20MB                                       ; (max
main logfile bytes b4 rotation   ; default 50MB)
logfile_backups=10                                          ; (num of
main logfile rotation backups ; default 10)
loglevel=debug                                              ; (log
level                            ; default info                  ;
others: debug,warn,trace)
pidfile=/myhome-dir/etc/supervisord.pid                      ;
(supervisord pidfile                  ; default supervisord.pid)
;nodaemon=true                                              ; (start
in foreground if true          ; default false)
nodaemon=false
minfds=1024                                                 ; (min.
avail startup file descriptors  ; default 1024)
minprocs=200                                                ; (min.
avail process descriptors       ; default 200)
childlogdir=/myhome-dir/logs/user/


I am not sure why supervisord is not respecting logfile_maxbytes and
logfile_backupds. The version of supervisord that I have installed is
3.0a12.

Any help is appreciated,
Thanks & Regards,
Divick
_______________________________________________
Supervisor-users mailing list
[hidden email]
http://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Supervisord keeping logs of only last 7 days

Andres Reyes
Are you running logrotate in conjunction with supervisord?

2012/7/2 Divick Kishore <[hidden email]>:

> Hi,
>      I am seeing strange behavior with supervisord logging. I see that
> the logs are only maintained for last 7 days and the logs are not
> being rotated based on file size. This is the configuration that I
> have for supervisord:
>
> [supervisord]
> logfile=/myhome-dir/logs/user/supervisord.log ; (main log file
>                ; default $CWD/supervisord.log)
> logfile_maxbytes=20MB                                       ; (max
> main logfile bytes b4 rotation   ; default 50MB)
> logfile_backups=10                                          ; (num of
> main logfile rotation backups ; default 10)
> loglevel=debug                                              ; (log
> level                            ; default info                  ;
> others: debug,warn,trace)
> pidfile=/myhome-dir/etc/supervisord.pid                      ;
> (supervisord pidfile                  ; default supervisord.pid)
> ;nodaemon=true                                              ; (start
> in foreground if true          ; default false)
> nodaemon=false
> minfds=1024                                                 ; (min.
> avail startup file descriptors  ; default 1024)
> minprocs=200                                                ; (min.
> avail process descriptors       ; default 200)
> childlogdir=/myhome-dir/logs/user/
>
>
> I am not sure why supervisord is not respecting logfile_maxbytes and
> logfile_backupds. The version of supervisord that I have installed is
> 3.0a12.
>
> Any help is appreciated,
> Thanks & Regards,
> Divick
> _______________________________________________
> Supervisor-users mailing list
> [hidden email]
> http://lists.supervisord.org/mailman/listinfo/supervisor-users



--
Andrés Reyes Monge
[hidden email]
+(505)-8873-7217
_______________________________________________
Supervisor-users mailing list
[hidden email]
http://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Supervisord keeping logs of only last 7 days

Divick Kishore
HI Andres,
                thanks for the quick reply.

On Mon, Jul 2, 2012 at 8:51 PM, Andres Reyes <[hidden email]> wrote:
> Are you running logrotate in conjunction with supervisord?
>

Aah I see that logrotated is being run via cron on the centos
installation on my server. I see that it is rotating logs of
supervisord because logrotated is also configured to rotate logs in
the same directory where supervisord logs are stored. It seems I will
need to store supervisord logs in a different directory. Is there any
other simpler solution?

Thanks for the help,
Regards,
Divick
_______________________________________________
Supervisor-users mailing list
[hidden email]
http://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Supervisord keeping logs of only last 7 days

Andres Reyes
Hi

You could also use logrotate instead of supervisord's log rotation,
for that you need to set

logfile_maxbytes = 0

You just have to remember to send SIGUSR2 in postrotate,

something like

kill -SIGUSR2 `cat /var/run/supervisord.pid`

Cheers

http://supervisord.org/running.html#signal-handlers

2012/7/2 Divick Kishore <[hidden email]>:

> HI Andres,
>                 thanks for the quick reply.
>
> On Mon, Jul 2, 2012 at 8:51 PM, Andres Reyes <[hidden email]> wrote:
>> Are you running logrotate in conjunction with supervisord?
>>
>
> Aah I see that logrotated is being run via cron on the centos
> installation on my server. I see that it is rotating logs of
> supervisord because logrotated is also configured to rotate logs in
> the same directory where supervisord logs are stored. It seems I will
> need to store supervisord logs in a different directory. Is there any
> other simpler solution?
>
> Thanks for the help,
> Regards,
> Divick



--
Andrés Reyes Monge
[hidden email]
+(505)-8873-7217
_______________________________________________
Supervisor-users mailing list
[hidden email]
http://lists.supervisord.org/mailman/listinfo/supervisor-users