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