Ivan Marton <git...@martonivan.hu> added the comment:

Well, there is nothing in the documentation that would say the logrotation can 
be only performed by continously running scripts, thats why. :)

There are scripts or even daemons written in Python that need to be restarted 
from time to time. If the logrotate period is greater than restart period the 
log files will never be rotated, however they could be.

We were looking for something that works like the logrotate do, but without 
involving any external logic, but the one written in python. And 
TimedLogrotateHandler appears to be one of those, unless it checks the MTIME of 
the files instead of the CTIME.

What is the logic behind checking the MTIME instead of CTIME when one is 
calculating the age of a file when tries to calculate whether it has to be 
rotated or not? If the only purpose of this initial rollover calculation would 
be to start a predefined long period (as you suggest), now() (time of 
execution) should used instead and no file attribute should be involved. From 
the code I have to assume that the original author also tried to prepare for 
the cases where the execution is interrupted and/or restarted and (s)he wanted 
the TimedLogrotateHandler to be resumed where it was during the previous 
execution. Dnn't you agree?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40469>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to