Sync unhandled exception logging change from Oslo

Copying changes from 1 Oslo commit: Ibf00173a07510b2ec0c81a29624004f17810a4e4
This is related to the bug fix for adding error type to unhandled
exception log message.
Change-Id: Ie8af57a148753121f79136af928feb0edaea228b
Closes-Bug: #1265561 
This commit is contained in:
Mahesh Panchaksharaiah
2014年01月21日 16:26:09 +05:30
parent 1e74b8677a
commit 14dbccf119

View File

@@ -391,9 +391,11 @@ class JSONFormatter(logging.Formatter):
def _create_logging_excepthook(product_name):
def logging_excepthook(exc_type, value, tb):
extra = {}
if CONF.verbose:
if CONF.verbose or CONF.debug:
extra['exc_info'] = (exc_type, value, tb)
getLogger(product_name).critical(str(value), **extra)
getLogger(product_name).critical(
"".join(traceback.format_exception_only(exc_type, value)),
**extra)
return logging_excepthook
Reference in New Issue
openstack/nova
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.