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:
1 changed files with 4 additions and 2 deletions
@@ -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
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.