TimedRotatingFileHandler() isn't rotating at midnight?

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Feb 9 06:50:36 EST 2007


On 1 Feb, 05:32, Chris Shenton <chris-list-pyt... at shenton.org> wrote:
> I set this up 3 days ago and have not seen any of the logs I've
> created this way being rotated.  I expected them to rotate every
> midnight.  I'm calling the code that uses this logger many times, each
> a separate run, if that matters.

It might. I assume you have a long-running process which runs past
midnight - that's the scenario that TimedRotatingFileHandler is meant
for. Can you post a complete minimal example which shows the problem?

> Am I doing something stupid? I can't find anything on google and don't
> see anything in the code that would prevent rotating.
>

Rotating should happen when the logging process creates the handler
before midnight and makes a logging call destined for that handler
after midnight.

Regards,

Vinay Sajip




More information about the Python-list mailing list