classification
Title: TimedRotatingFileHandler fails to handle intervals of several weeks correctly
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: exec, petri.lehtinen, vinay.sajip
Priority: normal Keywords:

Created on 2011-11-24 07:10 by exec, last changed 2011-11-24 16:56 by vinay.sajip. This issue is now closed.

Messages (2)
msg148230 - (view) Author: Jussi Eronen (exec) Date: 2011-11-24 07:10
When specifying a time period of several weeks, say when w0 and interval 4, the rollover still happens weekly instead of every 4 weeks. The log file names are as though the rollover happens every 4 weeks, which furthers the confusion. 

In the file system, it looks like this:

-rw-r----- 1 x x  94189100 2011-10-24 23:59 x.log.2011-09-27
-rw-r----- 1 x x  51059765 2011-11-01 00:59 x.log.2011-10-04

This seems to be the result of computeRollover not handling multiple weeks at all.
msg148282 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-11-24 16:56
TimedRotatingFileHandler does not, by design, support multiple-week rollovers: the W mode is for a specific day of the week, and is documented as "Weekday" rather than "Weeks" (the other modes are documented as Seconds, Minutes, Hours, Days).

I don't currently have time to consider such support, but I'll certainly look at a patch (with tests).
History
Date User Action Args
2011-11-24 16:56:40vinay.sajipsetstatus: open -> closed
resolution: not a bug
messages: + msg148282
2011-11-24 12:26:25pitrousetnosy: + vinay.sajip

type: behavior
versions: + Python 2.7, Python 3.2, Python 3.3, - Python 2.6
2011-11-24 07:23:52petri.lehtinensetnosy: + petri.lehtinen
2011-11-24 07:10:39execcreate