Stop logging all registry client exceptions
Not all exceptions need to be logged as ERROR in the glance-api log when - for instance, a user asking for an image that does not exist doesn't mean an ERROR actually occurred. This logs the exception name at INFO level. An ERROR won't be logged at all, even in the case of a 500-level response from glance-registry. An operator would be alerted with an ERROR log in the glance-registry log in that case. Fixes bug 1079211. Change-Id: Ie2bba3105f8d9f3de97bc50132fb046baf710a90
This commit is contained in:
parent
6d57df0eda
commit
e063993246
@ -94,9 +94,10 @@ class RegistryClient(BaseClient):
|
||||
" request id %(request_id)s")
|
||||
LOG.debug(msg % locals())
|
||||
|
||||
except:
|
||||
LOG.exception(_("Registry request %(method)s %(action)s "
|
||||
"Exception") % locals())
|
||||
except Exception as exc:
|
||||
exc_name = exc.__class__.__name__
|
||||
LOG.info(_("Registry client request %(method)s %(action)s "
|
||||
"raised %(exc_name)s") % locals())
|
||||
raise
|
||||
return res
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user