logging to two files

Laszlo Zsolt Nagy gandalf at geochemsource.com
Wed Apr 20 11:51:02 EDT 2005


Tor Erik Sønvisen wrote:

>Hi
>
>Have the following code:
>import logging
>
>        logging.basicConfig(level = logging.DEBUG,
>                            format = '[%(levelname)-8s %(asctime)s] 
>%(message)s',
>                            filename = 'rfs.log',
>                            filemode = 'w')
>
>When using logging.(debug, info etc) stuff is logged to rfs.log.
>How may I specify another log with different charateristics, such as a 
>different file
>
>regards 
>
>
>  
>
I'm not sure if I understood your problem. However, just a tip for you: 
is it possible to create your own handler object? (See section 6.29.5 in 
the library reference).
You could setup a handler object that holds a list of other handler 
objects and distribute all logging events to them. This way you should 
be able to add/remove handlers at runtime.

Best,

   Laci 2.0

-- 
_________________________________________________________________
  Laszlo Nagy		      web: http://designasign.biz
  IT Consultant		      mail: gandalf at geochemsource.com

     		Python forever!





More information about the Python-list mailing list