[issue8034] logging: Improve error handing in RotatingFileHandler.doRollover()

STINNER Victor report at bugs.python.org
Mon Mar 1 12:09:36 CET 2010


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

I forgot something: to avoid trying to file rotation at each log message, the rotation should be disabled at the first error. For RotatingFileHandler, it can be something like:
 try:
  ...
 except:
  self.maxBytes=0
  raise

For TimedRotatingFileHandler, a flag (new attribute) would be required.

I'm not sure that disabling the rotation if the first rotation failure is a good idea, but most the time if the logging system is broken, the application starts to fail randomly :-/ Anyway, the first rotation exception is still raised and so would be catched by something :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8034>
_______________________________________


More information about the Python-bugs-list mailing list