Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue9556

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Specifying the time a TimedRotatingFileHandler rotates
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.4
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: vinay.sajipNosy List: eric.araujo, python-dev, ronaldoussoren, tshepang, vinay.sajip
Priority:normalKeywords:patch

Created on2010-08-10 11:57 byronaldoussoren, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
issue9556.txtronaldoussoren,2012-10-23 10:09review
updated-patch.diffvinay.sajip,2012-10-23 21:43Added weekly test, docs to Ronald's patchreview
post-comments.diffvinay.sajip,2012-10-24 12:55Taking Ronald's comments into accountreview
Repositories containing patches
http://hg.python.org/sandbox/vsajip#fix9556
Messages (7)
msg113527 -(view)Author: Ronald Oussoren (ronaldoussoren)*(Python committer)Date: 2010-08-10 11:57
The logging module contains a TimedRotatingFileHandler that automaticly rotates the logfile after a specified interval.This class misses an important feature: it is not possible to specify at what time the file should be rotated, unless that time is midnight.My usecase: one of our customers works night shifts which means that rotating logfiles at midnight means that files get rotated halfway through a shift instead of at the end of one.We'd like to be able to specify that logfiles get rotated at a specific time (such as 7:00AM).
msg113565 -(view)Author: Éric Araujo (eric.araujo)*(Python committer)Date: 2010-08-10 22:21
Adding the logging maintainer to nosy. (BTW Vinay,Misc/maintainers.rst says your roundup name is “vsajip”)
msg114693 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2010-08-22 18:47
One way of implementing this is to use an additional optional "atTime" parameter which is a datetime.time instance, defaulting to None; a specified value would only be used if a 'when' value of 'D' or 'MIDNIGHT' were specified. In that case, computeRollover would be called with the specified time instead of the current time.Would that meet your requirements?
msg173587 -(view)Author: Ronald Oussoren (ronaldoussoren)*(Python committer)Date: 2012-10-23 10:09
An 'atTime' argument would work. I'm currently using a subclass of BaseRotatingHandler that implements just the 'MIDNIGHT' option of TimedRotatingFileHandler  with a rotation hour argument.The attached patch is a first attempt at implementing the 'atTime' option, it is currently lacking documentation and tests for the 'WEEKLY' value for 'when'.
msg173639 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2012-10-23 21:42
Thanks for the patch. I've added the weekly test and the documentation update, can you take a look?
msg173678 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2012-10-24 12:59
Thanks for the comments on Rietveld - patch updated.
msg186648 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2013-04-12 16:04
New changeseteead4be1bdd9 by Vinay Sajip in branch 'default':Closed#9556: Allowed specifying a time-of-day for a TimedRotatingFileHandler to rotate.http://hg.python.org/cpython/rev/eead4be1bdd9
History
DateUserActionArgs
2022-04-11 14:57:05adminsetgithub: 53765
2013-04-12 16:04:35python-devsetstatus: open -> closed

nosy: +python-dev
messages: +msg186648

resolution: fixed
stage: patch review -> resolved
2013-03-07 10:46:55tshepangsetnosy: +tshepang
2012-10-24 12:59:07vinay.sajipsetmessages: +msg173678
2012-10-24 12:55:58vinay.sajipsetfiles: +post-comments.diff
2012-10-23 21:46:05vinay.sajipsetstage: needs patch -> patch review
2012-10-23 21:43:13vinay.sajipsetfiles: +updated-patch.diff
keywords: +patch
2012-10-23 21:42:51vinay.sajipsethgrepos: + hgrepo156
messages: +msg173639
2012-10-23 10:09:44ronaldoussorensetfiles: +issue9556.txt
status: pending -> open
messages: +msg173587

versions: + Python 3.4, - Python 3.2
2010-08-22 18:47:36vinay.sajipsetstatus: open -> pending
assignee:vinay.sajip
messages: +msg114693
2010-08-10 22:21:45eric.araujosetnosy: +vinay.sajip,eric.araujo
messages: +msg113565
2010-08-10 11:58:03ronaldoussorensettype: behavior -> enhancement
2010-08-10 11:57:35ronaldoussorencreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp