TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


Forums >


Re: python logging writes an empty file

Ovidiu Deac

3/26/2010 2:30:00 PM

> You set le level of your handler, but did not set the level of the logger
> itself.
> Replace file.setLevel(logging.INFO) by
> logging.getLogger().setLevel(logging.INFO)
> Log events are matched versus the logger level 1st, then the handler level
> (if applicable). Most of the time you don't need to tune your handler
> levels.

Right. Thanks a lot!!!

Now for the second part, any idea why logging.config.fileConfig doesn't work?

Now the logging.conf looks like this:

keys: detailed

keys: console,file

keys: root

format: %(name)s:%(levelname)s %(module)s:%(lineno)d: %(message)s

class: StreamHandler
args: []
formatter: detailed

args=('output.log', 'w')

level: INFO
handlers: file