From 6dc5dde51765bc1cede519e42b27f30eb23e07e3 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Tue, 15 Jan 2013 12:31:53 -0800 Subject: Make nova-api logs more useful The current logs make it hard to identify what API command is actually being called, especially for POST, where the action is in the body. * Whenever there is body, log it (info level) * Log what function the API command maps to (debug level) Change-Id: Ief14186b94e321d97575ee25e3507d3fc0178de6 --- nova/api/openstack/wsgi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 519669134..733685b14 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -919,6 +919,10 @@ class Resource(wsgi.Application): msg = _("Malformed request body") return Fault(webob.exc.HTTPBadRequest(explanation=msg)) + if body: + LOG.info(_("Action: '%(action)s', body: %(body)s") % locals()) + LOG.debug(_("Calling method %s") % meth) + # Now, deserialize the request body... try: if content_type: -- cgit