Logging help

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Jan 20 10:03:35 EST 2009


En Tue, 20 Jan 2009 08:11:52 -0200, koranthala <koranthala at gmail.com>  
escribió:
> On Jan 20, 5:45 am, Chris Rebert <c... at rebertia.com> wrote:
>> On Mon, Jan 19, 2009 at 11:36 AM, koranthala <koranth... at gmail.com>  
>> wrote:

>> >   Is it possible somehow to have the logging module rotate the files
>> > every time I start it.
>> >   Basically, I can automatically rotate using RotatingFileHandler;
>> >                                               ^^^^^^^^^^^^^^^^^^^ >  
>> Now I want it rotated every time I start the program too.
>>
>> Just call the .doRollover() method of the RotatingFileHandler at the
>>                                           ^^^^^^^^^^^^^^^^^^^ start of  
>> the program.
>> Reading The Fine Documentation for the module is helpful.
>
> Current doRollover method is not very helpful to rolling over every
> day if the process starts and stops many times.
> For example:
> TimedRotatingFileHandler - when='D' Interval=1. I call
> ^^^^^^^^^^^^^^^^^^^^^^^^ handler.doRollover everytime process starts.

Why the move to TimedRotatingFileHandler?

-- 
Gabriel Genellina




More information about the Python-list mailing list