the fix was to specify handler.RotatingFileHandler
does RotatingFileHandler work with Windows XP?
john peter <[EMAIL PROTECTED]> wrote:
john peter <[EMAIL PROTECTED]> wrote:
Hi!I have the following logging.conf :[loggers]
keys=root[handlers]
keys=roth[formatters]
keys=simpleFormatter[logger_root]
level=INFO
handlers=roth[handler_roth]
class=RotatingFileHandler
level=INFO
formatter=simpleFormatter
args=('adssim.log','w', 200, 4)[formatter_simpleFormatter]
format=%(asctime)s - %(message)s
datefmt=and sampleLogging.py script:!import loggingimport logging.configlogging.config.fileConfig("logging.conf")logger = logging.getLogger("root")for i in xrange(0, 5000):logger.debug("debug message %s" % i)logger.info("info message %s" % i)logger.warn("warn! message %s" % i)logger.error("error message %s" % i)logger.critical("critical message %s" % i)for some reason, i keep getting the following error message:C:\adssim1>python sampleLogging.py
Traceback (most recent call last):
File "C:\Python24\lib\logging\config.py", line 157, in fileConfig
log.addHandler(handlers[hand])
KeyError: 'roth'
No handlers could be found for logger "root"when i did a help(logging) on the logging module, i don't see RotatingFileHandler.Could somebody please help? Thanks!
What are the most popular cars? Find out at Yahoo! Autos --
http://mail.python.org/mailman/listinfo/python-list
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.-- http://mail.python.org/mailman/listinfo/python-list
- Re: FOLLOW-UP how to use RotatingFileHandler john peter
- Re: FOLLOW-UP how to use RotatingFileHandler Peter Hansen
Reply via email to