Getting a TimedRotatingFileHandler not to put two dates in the same file?

David M Chess chess at us.ibm.com
Tue Oct 23 11:23:17 EDT 2012


We have a TimedRotatingFileHandler with when='midnight'. 

This works great, splitting the log information across files by date, as 
long as the process is actually up at midnight.

But now the users have noticed that if the process isn't up at midnight, 
they can end up with lines from two (or I guess potentially more) dates in 
the same log file.

Is there some way to fix this, either with cleverer arguments into the 
TimedRotatingFileHandler, or by some plausible subclassing of it or its 
superclass?

Or am I misinterpreting the symptoms somehow?

Tx much!
DC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121023/6f4af975/attachment.html>


More information about the Python-list mailing list