log: Make other logging work when logging/config_file is in use

This commit is contained in:
Stein Magnus Jodal 2014-01-23 22:49:29 +01:00
parent 06640f1f0c
commit 7d2906d58d

View File

@ -34,14 +34,16 @@ def bootstrap_delayed_logging():
def setup_logging(config, verbosity_level, save_debug_log):
logging.captureWarnings(True)
if config['logging']['config_file']:
# Logging config from file must be read before other handlers are
# added. If not, the other handlers will have no effect.
logging.config.fileConfig(config['logging']['config_file'])
setup_log_levels(config)
setup_console_logging(config, verbosity_level)
if save_debug_log:
setup_debug_logging_to_file(config)
if config['logging']['config_file']:
logging.config.fileConfig(config['logging']['config_file'])
_delayed_handler.release()