python logging module and custom handler specified in config file

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Oct 19 07:22:33 EDT 2007


On 19 Oct, 12:04, Frank Aune <Frank.A... at broadpark.no> wrote:
> On Thursday 18 October 2007 19:26:59 Vinay Sajip wrote:
>
> 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
>

You can use ConfigParser interpolation. See this post by Gabriel
Genellina:

http://groups.google.co.uk/group/comp.lang.python/tree/browse_frm/thread/5a7bc2892a2875b4/337b080d0522e555?rnum=1&q=logging&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2F5a7bc2892a2875b4%2Ff42cca545d8b339c%3Flnk%3Dgst%26q%3Dlogging%26#doc_f42cca545d8b339c

Regards,


Vinay




More information about the Python-list mailing list