Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75692 > unrolled thread

Re: creating log file with Python logging module

Started byPeter Otten <__peter__@web.de>
First post2014-08-04 16:03 +0200
Last post2014-08-04 16:03 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: creating log file with Python logging module Peter Otten <__peter__@web.de> - 2014-08-04 16:03 +0200

#75692 — Re: creating log file with Python logging module

FromPeter Otten <__peter__@web.de>
Date2014-08-04 16:03 +0200
SubjectRe: creating log file with Python logging module
Message-ID<mailman.12643.1407161038.18130.python-list@python.org>
Peter Otten wrote:

> Peter Otten wrote:
> 
>> You won't see a rollover if you restart it.
> 
> Sorry, I tried it and the above statement is wrong.

[Arulnambi Nandagoban]

> logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s -
> %(message)s', datefmt='%a, %d %b %Y %H:%M:%S', level = logging.DEBUG,
> filename=Ffilename, filemode='w')
> 
> logger = logging.getLogger(__name__)
> 
> hdlr = TimedRotatingFileHandler(Ffilename, when='midnight')

My alternative theory about what might be going wrong: you are using the 
same file in logging.basicConfig() and the TimedRotatingFileHandler.

But I cannot replicate the problem on my (linux) system.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web