Whit helped me come up with a solution that *almost* works.  supervisord now
exclusively manages the app's log files.  The problem, however, seems that
supervisord is buffering its log output.  For example, the app is chef, it
runs every 10 minutes and its log reads:

[Fri, 19 Nov 2010 22:07:14 +0000] INFO: Starting Chef Run (Version 0.9.8)

then 10 minutes later, this appears in the log:

[Fri, 19 Nov 2010 22:07:18 +0000] INFO: Chef Run complete in 3.965152
seconds

[Fri, 19 Nov 2010 22:07:18 +0000] INFO: Running report handlers

[Fri, 19 Nov 2010 22:07:18 +0000] INFO: Report handlers complete

[Fri, 19 Nov 2010 22:17:29 +0000] INFO: Starting Chef Run (Version 0.9.8)
Notice that the first three lines above are really from the prior chef run.
So strangely, only the first line is logged per chef run until the next app
run which then seems to flush the buffer and log again only the first line
of that next run.  My config:

[program:chef-client]
command=/usr/bin/chef-client -i 600 -s 20
pidfile=/var/run/chef-client.pid
redirect_stderr=true
stdout_logfile=/var/log/chef-client.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=5

See anything I'm doing wrong?

Thanks.
- Rob


On Fri, Nov 19, 2010 at 11:27 AM, whit <[email protected]> wrote:

> Rob Guttman wrote:
> > I'm supervising a process that seems to hold onto the file descriptor
> > after supervisord rotates its logs - so it continues writing to the
> > renamed log file (e.g., "foo.log.1").  A workaround would be for
> > supervisord to simply restart the process whenever it rotates its logs.
> > Is that possible?  How best/easiest to do that?
> >
> > Thanks!
> > - Rob
> >
>
> If you are logging through supervisor, the patch I just sent to the list
> will solve this problem. If your application is logging directly to a
> file supervisor is managing rotation for, you would need to manage that
> from within your application (say, by restarting).
>
> -w
>
> --
>  >>>
> Whit Morriss
> CodeMonkey
> [email protected]
>
> _______________________________________________
> Supervisor-users mailing list
> [email protected]
> http://lists.supervisord.org/mailman/listinfo/supervisor-users
>
_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to