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
 
 
 
 



What are the most popular cars? Find out at Yahoo! Autos
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to