<DIV id=RTEContent>i'm using python's logging facilities in all of my application modules.</DIV> <DIV>my logging.conf file is:</DIV> <DIV>[loggers]<BR>keys=root</DIV> <DIV>[handlers]<BR>keys=roth</DIV> <DIV>[formatters]<BR>keys=simpleFormatter</DIV> <DIV>[logger_root]<BR>level=DEBUG<BR>handlers=roth</DIV> <DIV>[handler_roth]<BR>class=handlers.RotatingFileHandler<BR>level=DEBUG<BR>formatter=simpleFormatter<BR>args=('adssim.log','w', 2000000, 4)</DIV> <DIV>[formatter_simpleFormatter]<BR>format=%(asctime)s - %(message)s<BR>datefmt=%Y-%m-%d %H:%M:%S</DIV> <DIV> </DIV> <DIV>i'm "creating" a logger in my adslogging module in the following way:</DIV> <DIV>import logging<BR>import logging.config</DIV> <DIV><BR>logging.config.fileConfig("logging.conf")<BR>logger = logging.getLogger("root")</DIV> <DIV> </DIV> <DIV>all my app modules import the adslogging module, and refer to the logger</DIV> <DIV>as adslogging.logger and perform stuff like
adslogging.logger.debug(msg1)</DIV> <DIV>or adslogging.logger.info(msgN)</DIV> <DIV> </DIV> <DIV>although i'm not explicitly closing the logfile and i don't think the logfile size has</DIV> <DIV>maxed out (i see one logfile under my app directory with size 31K), i'm getting the following error messages in windows xp. what might i be doing wrong?</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>C:\adssim1>python adstest.py 19.52.160.171 139 W04<BR><BR>Traceback (most recent call last):<BR> File "C:\Python24\lib\logging\handlers.py", line 71, in emit<BR> if self.shouldRollover(record):<BR> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover<BR> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature<BR>ValueError: I/O operation on closed file<BR>Traceback (most recent call last):<BR> File "C:\Python24\lib\logging\handlers.py", line 71, in emit<BR> if
self.shouldRollover(record):<BR> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover<BR> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature<BR>ValueError: I/O operation on closed file<BR>Traceback (most recent call last):<BR> File "C:\Python24\lib\logging\handlers.py", line 71, in emit<BR> if self.shouldRollover(record):<BR> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover<BR> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature<BR>ValueError: I/O operation on closed file<BR>Traceback (most recent call last):<BR> File "C:\Python24\lib\logging\handlers.py", line 71, in emit<BR> if self.shouldRollover(record):<BR> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover<BR> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature<BR>ValueError: I/O
operation on closed file<BR>Traceback (most recent call last):<BR> File "C:\Python24\lib\logging\handlers.py", line 71, in emit<BR> if self.shouldRollover(record):<BR> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover<BR> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature<BR>ValueError: I/O operation on closed file<BR></DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV><p>
<hr size=1> <BR>
What are the most popular cars? Find out at <a href="http://us.rd.yahoo.com/evt=38382/_ylc=X3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMmF1dG9z/*http://autos.yahoo.com/newcars/popular/thisweek.html
">Yahoo! Autos</a>