Use LOG.exception in except block in status module
LOG.error doesn't display a stacktrace even when called in an except block. It makes hard for operators to analyze the cause of the error. LOG.exception displays a stacktrace as well as log messages. It helps the operator to find out more about the error from log messages. Change-Id: I365152b631870c1b949a29ac73b3ad2bd077bffa
This commit is contained in:
parent
98a203b3e7
commit
3d22669334
@ -203,7 +203,7 @@ class LeaseStatus(BaseStatus):
|
||||
try:
|
||||
result = func(*args, **kwargs)
|
||||
except Exception as e:
|
||||
LOG.error('Lease %s went into ERROR status. %s',
|
||||
LOG.exception('Lease %s went into ERROR status. %s',
|
||||
lease_id, str(e))
|
||||
db_api.lease_update(lease_id,
|
||||
{'status': cls.ERROR})
|
||||
|
Loading…
Reference in New Issue
Block a user