This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martonivan
Recipients markhallett, martonivan, vinay.sajip
Date 2021-08-13.07:09:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628838583.53.0.703130832601.issue40469@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-08-13 07:09:43martonivansetrecipients: + martonivan, vinay.sajip, markhallett
2021-08-13 07:09:43martonivansetmessageid: <1628838583.53.0.703130832601.issue40469@roundup.psfhosted.org>
2021-08-13 07:09:43martonivanlinkissue40469 messages
2021-08-13 07:09:43martonivancreate