Improve serviceability and usability for API, adding more logs in API layer
1. Run below curl command, you will get a message says "An object with the specified identifier was not found".
# curl -i -X GET -H 'X-Auth-Token: d1aafceeb8f14a0
HTTP/1.1 404 Not Found
Content-Length: 187
Content-Type: text/html; charset=UTF-8
X-Openstack-
Date: Wed, 09 Oct 2013 03:38:24 GMT
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>404 Not Found</h1>
GL-4060EB6 An object with the specified identifier was not found.
</body>
Actual results: In /var/log/
But for Nova/Cinder/Neutron projects, they also print the exception to the log. Take Cinder as an example,
curl -i http://
HTTP/1.1 404 Not Found
Content-Length: 77
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Mon, 19 Aug 2013 15:58:59 GMT
{"itemNotFound": {"message": "Backup blah could not be found.", "code": 404}}
Then I can see this message in cinder log:
var/log/
2013-09-12 21:58:27.080 25419 INFO cinder.
So in order to improve Glance serviceability and usability, we'd better to keep consistent with other projects.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Yang Yu
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Format the response for glance API exception
This has by accident been partially implemented by https:/
I think this could be accepted on the following conditions
- it should not be a *warning* message on simple 4xx errors
- it should not be overly verbose at the INFO level. At the INFO level we should really only have one message per incoming request, for any normal circumstances (2xx, 3xx, 4xx http return codes).
- for backwards compatibility, we should not change the format of the api error responses
For now this looks abandoned.
markwash abandoned 2014-02-18