logging problem
Abel Ferreira
abelufsc at gmail.com
Mon Mar 10 08:26:42 EDT 2008
Hi.
I have a problem with python.
I dont wanna bother you, but
it's seem you had the same error.
Did you get solve this problem?
I know it's old, but if you remember, tell me.
i'm using python's logging facilities in all of my application modules.
> my logging.conf file is:
> [loggers]
> keys=root
> [handlers]
> keys=roth
> [formatters]
> keys=simpleFormatter
> [logger_root]
> level=DEBUG
> handlers=roth
> [handler_roth]
> class=handlers.RotatingFileHandler
> level=DEBUG
> formatter=simpleFormatter
> args=('adssim.log','w', 2000000, 4)
> [formatter_simpleFormatter]
> format=%(asctime)s - %(message)s
> datefmt=%Y-%m-%d %H:%M:%S
>
> i'm "creating" a logger in my adslogging module in the following way:
> import logging
> import logging.config
>
> logging.config.fileConfig("logging.conf")
> logger = logging.getLogger("root")
>
> all my app modules import the adslogging module, and refer to the logger
> as adslogging.logger and perform stuff like adslogging.logger.debug(msg1)
> or adslogging.logger.info(msgN)
>
> although i'm not explicitly closing the logfile and i don't think the logfile size has
> 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?
>
>
> C:\adssim1>python adstest.py 19.52.160.171 139 W04
>
> Traceback (most recent call last):
> File "C:\Python24\lib\logging\handlers.py", line 71, in emit
> if self.shouldRollover(record):
> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover
> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
> ValueError: I/O operation on closed file
> Traceback (most recent call last):
> File "C:\Python24\lib\logging\handlers.py", line 71, in emit
> if self.shouldRollover(record):
> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover
> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
> ValueError: I/O operation on closed file
> Traceback (most recent call last):
> File "C:\Python24\lib\logging\handlers.py", line 71, in emit
> if self.shouldRollover(record):
> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover
> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
> ValueError: I/O operation on closed file
> Traceback (most recent call last):
> File "C:\Python24\lib\logging\handlers.py", line 71, in emit
> if self.shouldRollover(record):
> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover
> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
> ValueError: I/O operation on closed file
> Traceback (most recent call last):
> File "C:\Python24\lib\logging\handlers.py", line 71, in emit
> if self.shouldRollover(record):
> File "C:\Python24\lib\logging\handlers.py", line 143, in shouldRollover
> self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
> ValueError: I/O operation on closed file
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080310/c7a11850/attachment.html>
More information about the Python-list
mailing list