python logging module and custom handler specified in config file

Frank Aune Frank.Aune at broadpark.no
Fri Oct 19 13:04:43 CEST 2007


On Thursday 18 October 2007 19:26:59 Vinay Sajip wrote:
> The values in the config file are interpreted in the context of the
> logging module's namespace. Hence, one way of achieving what you want
> is putting any custom handlers in
> a module of your own, and providing a binding in the logging module's
> namespace. 

What if you want to datestamp filenames for filehandlers, say with todays date 
for example?

[handler_file]
class=FileHandler
level=NOTSET
formatter=normal
args=('filename.log', 'w')

Say you want filenames to be on format filename-YYYYMMDD.log 

Thanks,
Frank



More information about the Python-list mailing list