From 7d2906d58db373f5f7326c140e8cb191bc3d0059 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 23 Jan 2014 22:49:29 +0100 Subject: [PATCH] log: Make other logging work when logging/config_file is in use --- mopidy/utils/log.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mopidy/utils/log.py b/mopidy/utils/log.py index c4045232..6004b9f9 100644 --- a/mopidy/utils/log.py +++ b/mopidy/utils/log.py @@ -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()