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 vinay.sajip
Recipients markhallett, martonivan, vinay.sajip
Date 2021-08-13.08:06:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628842000.08.0.134129067138.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. :)

Well, what's the need to rotate based on time when you just run scripts sporadically or they're very short-lived? Not trying to argue, just trying to understand.

> 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.

Yes, but generally daemons are long-lived relative to the rotation interval, aren't they? "From time to time" certainly implies that to me.

> 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?

I can't remember, that code is over 12 years old and that specific decision wasn't documented :-(

> 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?

I take it you mean TimedRotatingFileHandler. Certainly it assumes that the script might be restarted, which is why it opens the file in append mode.

If the computation using MTIME were changed to use CTIME, that would be a behaviour change, which could conceivably break someone's code that relied on current behaviour (unlikely, but you just never know). I've no other objection to using CTIME rather than MTIME - perhaps I'm just being hyper-cautious about breakage?
History
Date User Action Args
2021-08-13 08:06:40vinay.sajipsetrecipients: + vinay.sajip, markhallett, martonivan
2021-08-13 08:06:40vinay.sajipsetmessageid: <1628842000.08.0.134129067138.issue40469@roundup.psfhosted.org>
2021-08-13 08:06:40vinay.sajiplinkissue40469 messages
2021-08-13 08:06:39vinay.sajipcreate