On Mar 26, 4:26 pm, Ovidiu Deac <ovidiud...@gmail.com> 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 to *replace* any existing configuration. This means disabling any existing loggers which are not named explicitly, or not descendants of loggers named explicitly, in the configuration. Make sure you call logging.config.fileConfig() before any loggers have been instantiated in your code, or else ensure that all the top-level parents of those loggers (i.e. just below the root logger) are defined in the configuration. If you have version 2.6 or newer of Python, the fileConfig call has an optional keyword parameter disable_existing_loggers which has a default value of True, but which you can set to False to avoid disabling the existing loggers. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list