From c4b6fca586f5c7426cdcefab694edc8214df20e5 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 19 Feb 2013 18:07:38 -0800 Subject: Setup exception handler after configuring logging. We currently set up the exc handler before we configure logging. This means that an error in the setup will try to raise an exception which will then fail to log properly because we haven't set up handlers properly yet. Therefore, simply rely on the default exception handler during setup and setup our exception handler immediately after logging is configured. Fixes bug 1130464 Change-Id: I4b80c646a7d7d5048c8fbadc67dbb9f607d2af69 --- openstack/common/log.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'openstack') diff --git a/openstack/common/log.py b/openstack/common/log.py index 7d90975..b795ee4 100644 --- a/openstack/common/log.py +++ b/openstack/common/log.py @@ -325,16 +325,11 @@ def _create_logging_excepthook(product_name): def setup(product_name): """Setup logging.""" - sys.excepthook = _create_logging_excepthook(product_name) - if CONF.log_config: - try: - logging.config.fileConfig(CONF.log_config) - except Exception: - traceback.print_exc() - raise + logging.config.fileConfig(CONF.log_config) else: _setup_logging_from_conf(product_name) + sys.excepthook = _create_logging_excepthook(product_name) def set_defaults(logging_context_format_string): -- cgit