From 2f317ba79f262a8cd325844a1a258efab22e5fa1 Mon Sep 17 00:00:00 2001 From: Jason Kölker Date: Mon, 13 Feb 2012 16:26:31 -0600 Subject: Allow file logging config * Fixes lp904305 * remove module level log functions (getLogger to rule them all) * Move specific Environment logging to the one place it is used * Wrap getLogger to return a logger wrapped in a NovaContextAdapter * Do not overwrite the root logger * save_and_reraise_exception logs via error for passing exc_info * Uses CommonConfigOptions for compatability across Openstack Projects * Prefers CommonConfigOptions over legacy options * Install a NullHandler on the root logger if configured by FLAGS * Include example logging config file to mimic Nova defaults Change-Id: Ie59c3f755c142e2b7dc3b94b4e82e142e157bfac --- nova/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nova/utils.py') diff --git a/nova/utils.py b/nova/utils.py index 0af09e809..96f0a57f0 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1118,8 +1118,10 @@ def save_and_reraise_exception(): try: yield except Exception: - LOG.exception(_('Original exception being dropped'), - exc_info=(type_, value, traceback)) + # NOTE(jkoelker): Using LOG.error here since it accepts exc_info + # as a kwargs. + LOG.error(_('Original exception being dropped'), + exc_info=(type_, value, traceback)) raise raise type_, value, traceback -- cgit