Need help in configuration for TimedRotatingFileHandler

Lokesh lokeshmaremalla at gmail.com
Sun Aug 9 07:43:33 EDT 2009


Hi,

Need help in configure the TimedRotatingFileHandler from configuration
file

I have tried with the below code and ended up with the error, code is
pasted below
Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
\logs\rotate_test'
[loggers]
keys=root,simpleExample

[handlers]
keys=consoleHandler,timedRotatingFileHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[logger_simpleExample]
level=DEBUG
handlers=timedRotatingFileHandler
qualname=simpleExample
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

[handler_timedRotatingFileHandler]
class=handlers.TimedRotatingFileHandler
level=DEBUG
formatter=simpleFormatter
args=("G:\lok_sib\logs\rotate_test", 'midnight', 1)

[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt='%Y-%m-%d %H:%M:%S'


Thanks or your time
Regards,
Lokesh



More information about the Python-list mailing list