You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Akins <ba...@web.turner.com> on 2004/10/14 15:45:19 UTC

buffered logs + piped logs

If I enable buffered logs and use a log program (like rotate logs), it 
seems I loose whatever was in the buffer when I do a stop.  Is the pipe 
being closed before the buffer is being flushed?


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: buffered logs + piped logs

Posted by Brian Akins <ba...@web.turner.com>.
Theo Schlossnagle wrote:

> Out of curiosity, why is that not an option?  It's used at a lot of 
> _large_ sites.

politics.  A different group controls logs.


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: buffered logs + piped logs

Posted by Theo Schlossnagle <je...@omniti.com>.
Brian Akins wrote:

> Paul Querna wrote:
>
>> mod_log_spread:
>> http://www.backhand.org/mod_log_spread/
>>
>
> Unfortunantly, not an option here :(  I'm looking for something to 
> implement before the first Tuesday in November...
>
Out of curiosity, why is that not an option?  It's used at a lot of 
_large_ sites.

-- 
// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// Postal Engine -- http://www.postalengine.com/
// Ecelerity: fastest MTA on Earth


Re: buffered logs + piped logs

Posted by Brian Akins <ba...@web.turner.com>.
Paul Querna wrote:

> mod_log_spread:
> http://www.backhand.org/mod_log_spread/
> 

Unfortunantly, not an option here :(  I'm looking for something to 
implement before the first Tuesday in November...

-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: buffered logs + piped logs

Posted by Paul Querna <ch...@force-elite.com>.
Brian Akins wrote:
> I would like to be able to have "external" logging, so I can rotate with 
> out a restart.  I would also like to still be able to do graceful 
> restarts.  I thought about using unix domain sockets.  I didn't want to 
> replicate someone else's work.  I couldn't find anything on google.  Any 
> suggestions (doen's have to use unix sockets)?

mod_log_spread:
http://www.backhand.org/mod_log_spread/


Re: buffered logs + piped logs

Posted by Glenn Strauss <gs...@gluelogic.com>.
On Thu, Oct 14, 2004 at 02:03:06PM -0400, Brian Akins wrote:
> Joe Orton wrote:
> 
> >Speculation: the buffer is being flushed, but the piped logger is
> >SIGTERMed already just like the restart case, per PR 26467?
> 
> Perhaps.  Any progress on that?
> 
> My performance drops when I disable buffered logs, and I would like to 
> be able to do piped logs.  I modified rotatelogs to use a buffer similar 
> to buffered logs in mod_log_config.c.  It registers a sigterm handler to 
> flush the log.
> 
> I would like to be able to have "external" logging, so I can rotate with 
> out a restart.  I would also like to still be able to do graceful 
> restarts.  I thought about using unix domain sockets.  I didn't want to 
> replicate someone else's work.  I couldn't find anything on google.  Any 
> suggestions (doen's have to use unix sockets)?

http://cr.yp.to/daemontools/multilog.html

multilog automatically rotates logs when they reach
a certain size or when SIGALRM is received.
Upon receiving SIGTERM, multilog reads until end of
current line and then exits.  You might wish to disable
that behavior in the code if using it with Apache logging,
especially since multilog cleanly exits automatically
after reading EOF.  (YMMV -- I haven't tried blocking SIGTERM)

http://cronolog.org/

Cronolog automatically rotates logs based on a template,
so you can, say, rotate logs hourly or even more often if
desired.

If you do frequent graceful restarts on a busy server, then
multilog with SIGTERM blocked might be a better choice.
Check the cronolog mailing list for more on graceful restarts.
However, if your only reason for frequent graceful restarts
was to rotate logs, then either of the above are good choices.

I happen to use cronolog for rotating web logs, and I use
multilog for logging of a variety of other deamons.

Cheers,
Glenn

Re: buffered logs + piped logs

Posted by Brian Akins <ba...@web.turner.com>.
Joe Orton wrote:

> Speculation: the buffer is being flushed, but the piped logger is
> SIGTERMed already just like the restart case, per PR 26467?

Perhaps.  Any progress on that?

My performance drops when I disable buffered logs, and I would like to 
be able to do piped logs.  I modified rotatelogs to use a buffer similar 
to buffered logs in mod_log_config.c.  It registers a sigterm handler to 
flush the log.

I would like to be able to have "external" logging, so I can rotate with 
out a restart.  I would also like to still be able to do graceful 
restarts.  I thought about using unix domain sockets.  I didn't want to 
replicate someone else's work.  I couldn't find anything on google.  Any 
suggestions (doen's have to use unix sockets)?


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: buffered logs + piped logs

Posted by Joe Orton <jo...@redhat.com>.
On Thu, Oct 14, 2004 at 09:45:19AM -0400, Brian Akins wrote:
> If I enable buffered logs and use a log program (like rotate logs), it 
> seems I loose whatever was in the buffer when I do a stop.  Is the pipe 
> being closed before the buffer is being flushed?

Speculation: the buffer is being flushed, but the piped logger is
SIGTERMed already just like the restart case, per PR 26467?

joe