Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
It worked. Setting disable_existing_loggers=False fixed my problem. Thanks to both of you! Ovidiu On Fri, Mar 26, 2010 at 9:09 PM, Vinay Sajip wrote: > On Mar 26, 4:26 pm, Ovidiu Deac wrote: >> Anyway, thanks for the first part. >> >> Anybody else has any idea why using the same configuration f

Re: python logging writes an empty file

2010-03-26 Thread Vinay Sajip
On Mar 26, 4:26 pm, Ovidiu Deac wrote: > Anyway, thanks for the first part. > > Anybody else has any idea why using the same configuration file works > when running the tests with nosetests and doesn't work > withlogging.config.fileConfig() ? It's probably because the fileConfig code is intended

Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
Anyway, thanks for the first part. Anybody else has any idea why using the same configuration file works when running the tests with nosetests and doesn't work with logging.config.fileConfig() ? -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging writes an empty file

2010-03-26 Thread Jean-Michel Pichavant
Ovidiu Deac wrote: 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

Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
> 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 ne

Re: python logging writes an empty file

2010-03-26 Thread Jean-Michel Pichavant
Ovidiu Deac wrote: Then I tried this: file = logging.FileHandler(logFileBasename, 'w') file.setLevel(logging.INFO) # set a format which is simpler for console use formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s',) # tell the handler to use th

python logging writes an empty file

2010-03-25 Thread Ovidiu Deac
Hi, I have the following situation: My application uses nosetests to discover&run the unittests. I pass the log configuration file as --logging-config=logging.conf Everything works just fine, the logs are printed as required by the configuration file which makes me happy. I take this as a sign th