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

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to