FAQ

-------- Original Message --------
Subject: Re: Logging question
Date: Tue, 15 Dec 2009 18:28:54 +0000
From: Vinay Sajip at Red Dove <vinay_sajip at red-dove.com>
To: Yaroslav Molochko <onorua at gmail.com>



On 15/12/2009 14:29, Yaroslav Molochko wrote:
Hello Vinay Sajip,

my name is Yaroslav, I'm trying to use your logging module, and it's
working quite good. There is one issue I've figure out:

logging.basicConfig(filename=c_logfile,
level=logging_level, # By default logging is
in INFO mode. You can change it to DEBUG by -v variable
format="gert
:%(asctime)-10s%(msecs)d:%(levelname)s: %(message)s",
datefmt='%d%m %H%M%S.',)

if I use it, and delete the logfile it will not create the logfile
again. Only restart of the application will do. Is there any
workaround for this?
Hello Yaroslav,

Once you create a FileHandler, the file "belongs" to the logging package
which assumes it has exclusive access to the file. If the file is
deleted, in order to log to it again, you need to remove the existing
handler, close it, open a new handler, and attach it to the root logger.
For this you will have to use the other logging API functions.

Please post questions like this on comp.lang.python so that others can
join in the discussion.

Regards,

Vinay Sajip


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091216/cb2ce8f6/attachment.htm>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 16, '09 at 5:31p
activeDec 16, '09 at 5:31p
posts1
users1
websitepython.org

1 user in discussion

Vinay Sajip at Red Dove: 1 post

People

Translate

site design / logo © 2022 Grokbase