[Mongrel] Log rotation

David Vrensk david at vrensk.com
Wed Oct 11 08:39:43 EDT 2006

On 10/11/06, Dee Zsombor <dee.zsombor at gmail.com> wrote:
> Or use a custom script for well established logrotate. For once this is
> already used to rotate other logs in the system, and will work correctly
> unlike the above snippet prone to failure if multiple ruby processes try
> to rotate at the same time.

Yes, that would be preferrable.  But all logrotate does is (1) rename the
log file and (2, optional) send a signal to the application to let it know
that the log file has been renamed, and hence, the application should close
its file handle and open a new one.  Rails and Mongrel don't answer to a
signal with the semantics of (2) AFAIK.

Logrotate can also be used with applications that don't answer to a signal
but instead periodically (every five minutes or so) reopen their log file
handle.  My experiments with Rails in Mongrel indicate that Rails does not
do this.  But maybe I didn't wait long enough?  Either way, I don't want to
rely on Rails reopening the log files, since there is no guarantee that
different processes will do it at the same time.

So, thanks for your suggestion, but I'm afraid it won't solve the problem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/9d985130/attachment.html 

More information about the Mongrel-users mailing list