RotatingFileHandler - ShouldRollover error

tpatch at loftware.com tpatch at loftware.com
Wed Apr 16 09:50:44 EDT 2008


I am using the RotatingFileHandler logger with Python 2.5 on Windows and I am getting an error on the rollover.  When the log file gets close to the size where it needs to rollover, I start getting the following error for every log message.  Does anyone have a solution to this problem?

Traceback (most recent call last):
  File "C:\Python25\Lib\logging\handlers.py", line 73, in emit
    if self.shouldRollover(record):
  File "C:\Python25\Lib\logging\handlers.py", line 147, in shouldRollover
    self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
ValueError: I/O operation on closed file


My configuration file is setup as such:

[handler_file_detailed]
class:handlers.RotatingFileHandler
level:DEBUG
formatter:detailed
mode=a
maxsize=4000000
backcount=5
args:('python.log','a',4000000,5)

Thanks,

Todd

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080416/598fdde9/attachment.html>


More information about the Python-list mailing list