Subject: Re: Log rotation
To: Eric Haszlakiewicz <erh@jodi.nimenees.com>
From: john heasley <heas@shrubbery.net>
List: current-users
Date: 02/18/2005 18:19:51
Fri, Feb 18, 2005 at 06:44:31PM -0600, Eric Haszlakiewicz:
> On Fri, Feb 18, 2005 at 03:16:23PM -0800, john heasley wrote:
> > Fri, Feb 18, 2005 at 03:44:55PM -0700, Rick Kelly:
> > > Jeremy C. Reed said:
> > > 
> > > >newsyslog does the signal before it compresses the newly rotated file (and
> > > >after it creates new log file).
> > > 
> > > Back when www.rmkhome.com was running on NetBSD 1.4, I tried to use newsyslog
> > > to rotate the apache logs files. I found that it would rotate the files once,
> > > create the new empty log files, but apache would be logging to the old file
> > > descriptors, and nothing would get logged until I restarted apache. Has this
> > 
> > Wouldn't you rather just copy and truncate the log file?  I suggested such
> > a feature for newsyslog, but given timing there is a chance that some
> > messages could be missed.  Andrew Brown suggested cronolog as a better
> > solution for such log files.
> 	um.. it seems to me that copy+truncate would be a lot more vulnerable to
> that. i.e.:
> 	copy log
> 	message gets logged
> 	truncate log
> resulting in the last message being lost.

um.. i said it could lead to missed logs.

personally, i dont care about missing a few logs, i'd rather not restart
processes like httpd.  cronolog eliminates both, but does mean another
process - i have not tried it yet.