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.

classification
Title: TimedRotatingFileHandler doesn't rotate log file at startup.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, kwas, vinay.sajip, yorik.sar
Priority: normal Keywords: patch

Created on 2010-03-11 12:34 by yorik.sar, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-logging.diff yorik.sar, 2010-03-11 12:34
Messages (6)
msg100845 - (view) Author: Yuriy Taraday (yorik.sar) Date: 2010-03-11 12:34
Screnario:
 - start logging, log something;
 - stop logging (stop application, for example);
 - start logging again after rotate interval passes.

log4j's RotatingFileAppender's behavior:
After restart, logfile is rotated if nessesary.

TimedRotatingFileHandler's behavior:
After restart do no checks on existing logs.

I thing, log4j's behavior is more intuitive. Patch adds necessary check to constructor.
msg100901 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-03-12 06:03
Fix checked into trunk (r78853), thanks.
msg100905 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-03-12 08:25
I think this change is worth a sentence in the documentation.
"Improved algorithm" is a bit terse.
msg100908 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-03-12 09:18
Clarified Misc/NEWS entry and added a paragraph to the documentation on TimedRotatingFileHandler (r78855).
msg100917 - (view) Author: Yuriy Taraday (yorik.sar) Date: 2010-03-12 09:42
Can this change be included in the 2.6 release?
It's small enough but necessary for our current development.
msg100925 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-03-12 10:55
> From: Yuriy Taraday <report@bugs.python.org>

> Can this change be included in the 2.6 release?
> It's small enough but necessary for our current 
> development.

I'm sorry, Yuriy, I don't think it can be, as it's an enhancement rather than a bug fix. It does change existing behaviour, and strictly speaking it would break backward compatibility, so I can't merge it into the 2.6 maintenance tree - where no new features are allowed.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52364
2010-03-12 10:55:59vinay.sajipsetmessages: + msg100925
2010-03-12 09:42:19yorik.sarsetmessages: + msg100917
2010-03-12 09:18:53vinay.sajipsetstatus: open -> closed

messages: + msg100908
2010-03-12 08:25:08amaury.forgeotdarcsetstatus: closed -> open
nosy: + amaury.forgeotdarc
messages: + msg100905

2010-03-12 06:03:12vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg100901

versions: + Python 2.7, Python 3.2
2010-03-11 20:48:50kwassetnosy: + kwas
2010-03-11 14:22:46r.david.murraysetnosy: + vinay.sajip
2010-03-11 12:34:02yorik.sarcreate