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
This commit is contained in:
Jason Kölker 2012-02-13 16:26:31 -06:00
parent cf86bc4a4f
commit c6b1f5c0af

View File

@ -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