Logging help

koranthala koranthala at gmail.com
Thu Jan 22 01:49:10 EST 2009


On Jan 21, 2:55 pm, Vinay Sajip <vinay_sa... at yahoo.co.uk> wrote:
> On Jan 20, 10:11 am,koranthala<koranth... at gmail.com> wrote:
>
>
>
> > The doRollover method does not append to the earlier file. Rather, it
> > creates a new file with the same name.
>
> Err... that's what rollover means - switching to a new log file (and
> renaming the old ones). If it just appended to the old one, why would
> it be called doRollover ? ;-)
>
> Regards,
>
> Vinay Sajip

I understand Vinay. But my point is that I wanted a mechanism to
rotate the log files based on data - i.e. today one log, tomorrow
another. This is easier because when trouble tickets are raised, users
mention that X failed at this time.
Now, timedrotatingfilehandler does it - but only if the program is
running the whole length of time.
My tool is invoked by a cron job - so the program runs, then stops
again and again.
When I posted the question here, I was forwarded to the doRollover
mechanism as a solution.
I was just mentioning that doRollover, due to overwriting the files I
would lose everything that is stored before.
What I did now was to copy the file, and then append to the rolledover
file - which does serve the purpose.
But it is kludgy, and I dont think my situation is unique. I did see
other people asking for the same functionality.

So I was wondering whether it would be good idea to have this also in
the next version.



More information about the Python-list mailing list