diff options
| author | Jason Kölker <jason@koelker.net> | 2012-02-13 16:26:31 -0600 |
|---|---|---|
| committer | Jason Kölker <jason@koelker.net> | 2012-02-17 11:24:32 -0600 |
| commit | 2f317ba79f262a8cd325844a1a258efab22e5fa1 (patch) | |
| tree | 8aae34b0df7504f0cff796a9c3bcb3a1547d80e5 /nova/api | |
| parent | 676965280136407c9f69072e6fa468e9e2ea14eb (diff) | |
| download | nova-2f317ba79f262a8cd325844a1a258efab22e5fa1.tar.gz nova-2f317ba79f262a8cd325844a1a258efab22e5fa1.tar.xz nova-2f317ba79f262a8cd325844a1a258efab22e5fa1.zip | |
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
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py index 416783c45..937e1ed80 100644 --- a/nova/api/ec2/__init__.py +++ b/nova/api/ec2/__init__.py @@ -627,9 +627,13 @@ class Executor(wsgi.Application): context=context) return ec2_error(req, request_id, type(ex).__name__, unicode(ex)) except Exception as ex: - extra = {'environment': req.environ} - LOG.exception(_('Unexpected error raised: %s'), unicode(ex), - extra=extra, context=context) + env = req.environ.copy() + for k in env.keys(): + if not isinstance(env[k], basestring): + env.pop(k) + + LOG.exception(_('Unexpected error raised: %s'), unicode(ex)) + LOG.error(_('Environment: %s') % utils.dumps(env)) return ec2_error(req, request_id, 'UnknownError', _('An unknown error has occurred. ' 'Please try your request again.')) |
