On Thu, Apr 15, 2010 at 6:03 PM, Christian Hammond <chip...@chipx86.com>wrote:

> On Wed, Apr 14, 2010 at 11:38 AM, Matthew Woehlke <
> mw_tr...@users.sourceforge.net> wrote:
>> Apologies, I'm not sure I have understood what you wrote.
>> I would like to use logrotate to manage Review Board's logs. I think that
>> is what you mean when you say 'you should use some method provided by the
>> system'? But for that to work, Review Board needs to close and re-open the
>> log file, otherwise it will continue writing to the renamed (and eventually,
>> unlinked) log file rather than starting over.
>> It seems 'service lighttpd reload' instructs lighttpd to close and reopen
>> its log files. The question is, how to make Review Board do likewise? Will
>> Review Board also reload its logs when lighttpd is signaled? If not, is
>> there some other way to signal Review Board to reopen its log file?
>> If it isn't possible to signal Review Board to reopen its log file, then
>> some method other than logrotate is needed. (Or... re*start* lighttpd, but
>> that means a service interruption I would prefer to avoid.)
>> --
>> Matthew
> We use the standard Python logging functionality, which as far as I know
> doesn't really have a good way of knowing to close/reopen the log files for
> rotation. There is a built-in logging handler that auto-rotates, but this is
> only available in Python 2.6. I'll look into what can be done and reply
> again if I find anything, but right now restarting lighttpd may be your best
> option (sadly). There should be some solved solution for this in their
> logging code somewhere.
> Christian

Okay, it looks like Python 2.6 provides a logging handler we can use for
this -- WatchedFileHandler. It checks to see if the file has been
moved/renamed/deleted and then reopens. It's intended for use with logrotate
and such.

A couple caveats. First, it's only in Python 2.6. We can look into whether
it's easy or not to backport this. Second, it's only available for Linux,
which I suspect isn't a problem for you.

I can look into getting this in to the upcoming 1.0.7 release, and the 1.5
beta 2 release.


Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com

Want to help the Review Board project? Donate today at 
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to