Bugs item #1627575, was opened at 2007-01-04 06:08
Message generated for change (Comment added) made by vsajip
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1627575&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Forest Wilkinson (forest)
Assigned to: Vinay Sajip (vsajip)
Summary: RotatingFileHandler cannot recover from failed doRollover()

Initial Comment:
When RotatingFileHandler.doRollover() raises an exception, it puts the handler 
object in a permanently failing state, with no way to recover using 
RotatingFileHandler methods.  From that point on, the handler object raises an 
exception every time a message is logged, which renders logging in an 
application practically useless.  Furthermore, a handleError() method has no 
good way of correcting the problem, because the API does not expose any way to 
re-open the file after doRollover() has closed it.

Unfortunately, this is a common occurrence on Windows, because doRollover() 
will fail if someone is running tail -f on the log file.

Suggestions:

- Make doRollover() always leave the handler object in a usable state, even if 
the rollover fails.

- Add a reOpen() method to FileHandler, which an error handler could use to 
recover from problems like this.  (It would also be useful for applications 
that want to re-open log files in response to a SIGHUP.)



----------------------------------------------------------------------

>Comment By: Vinay Sajip (vsajip)
Date: 2007-01-09 14:56

Message:
Logged In: YES 
user_id=308438
Originator: NO

I've added an _open() method to logging.FileHandler [checked into trunk].
This facilitates reopening by derived class error handlers.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-01-04 06:27

Message:
Logged In: YES 
user_id=33168
Originator: NO

Vinay, was this addressed?  I thought there was a similar issue.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1627575&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to