Logging help

koranthala koranthala at gmail.com
Thu Jan 22 23:38:34 EST 2009


On Jan 22, 10:25 pm, Vinay Sajip <vinay_sa... at yahoo.co.uk> wrote:
> On Jan 22, 3:40 pm,koranthala<koranth... at gmail.com> wrote:
>
> > Thank you very much Vinay. You have been extremely helpful.
> > This was my first design - but then I found that log system was taking
> > up quite a huge chunk of the memory.
> > That is why I went to rotating file handler.
>
> Using just plain FileHandler takes up less memory than using
> RotatingFileHandler (because using the latter imports the "handlers"
> module into memory, whereas using the former does not). I'm not aware
> of any problem where logging takes up a huge chunk of memory (under
> normal usage) - how did you measure the memory usage which was due to
> logging?
>
> > Anyways, now I have modified doRollover to append if file is there,
> > so, for me it is working.
> > What I was thinking was such an option in the basicloggingsystem
> > might be of good help.
>
> The solution I suggested is IMO better than using a patched
> RotatiingFileHandler, both because it avoids importing an extra module
> (if memory really is a concern) and because you don't need to change
> your code across Python version updates. How does my suggestion to use
> FileHandler not meet your use case?
>
> > Again, Vinay, Thank you very much. You were extremely helpful.
>
> You're welcome.
>
> Best wishes,
>
> Vinay Sajip

oops - again I was very unclear in my post.
What i meant was that due to the log getting very big - i.e. the log
was in 100MB range (since it is a new product - a lot of debugging is
done via logs). Not RAM.
Having a rotating file handler helped there - because I could say only
5 such logs are needed.



More information about the Python-list mailing list