Log all transport actions
This patch adds debug LOG calls to the transport layer. Implements blueprint production-logging Change-Id: I43137ef4cff77ead9d5db931907952dc78a67157
This commit is contained in:
parent
0b2af6828a
commit
423af0931c
@ -50,6 +50,7 @@ class Bootstrap(object):
|
|||||||
invoke_on_load=True)
|
invoke_on_load=True)
|
||||||
return mgr.driver
|
return mgr.driver
|
||||||
except RuntimeError as exc:
|
except RuntimeError as exc:
|
||||||
|
LOG.exception(exc)
|
||||||
raise exceptions.InvalidDriver(exc)
|
raise exceptions.InvalidDriver(exc)
|
||||||
|
|
||||||
@decorators.lazy_property(write=False)
|
@decorators.lazy_property(write=False)
|
||||||
@ -62,6 +63,7 @@ class Bootstrap(object):
|
|||||||
invoke_args=[self.storage])
|
invoke_args=[self.storage])
|
||||||
return mgr.driver
|
return mgr.driver
|
||||||
except RuntimeError as exc:
|
except RuntimeError as exc:
|
||||||
|
LOG.exception(exc)
|
||||||
raise exceptions.InvalidDriver(exc)
|
raise exceptions.InvalidDriver(exc)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -17,8 +17,12 @@
|
|||||||
|
|
||||||
from keystoneclient.middleware import auth_token
|
from keystoneclient.middleware import auth_token
|
||||||
|
|
||||||
|
from marconi.openstack.common import log
|
||||||
|
|
||||||
STRATEGIES = {}
|
STRATEGIES = {}
|
||||||
|
|
||||||
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class KeystoneAuth(object):
|
class KeystoneAuth(object):
|
||||||
|
|
||||||
@ -35,6 +39,7 @@ class KeystoneAuth(object):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def install(cls, app, conf):
|
def install(cls, app, conf):
|
||||||
"""Install Auth check on application."""
|
"""Install Auth check on application."""
|
||||||
|
LOG.debug(_("Installing Keystone's auth protocol"))
|
||||||
cls._register_opts(conf)
|
cls._register_opts(conf)
|
||||||
conf = dict(conf.get(cls.OPT_GROUP_NAME))
|
conf = dict(conf.get(cls.OPT_GROUP_NAME))
|
||||||
return auth_token.AuthProtocol(app, conf=conf)
|
return auth_token.AuthProtocol(app, conf=conf)
|
||||||
|
@ -35,6 +35,9 @@ class CollectionResource(object):
|
|||||||
self.claim_controller = claim_controller
|
self.claim_controller = claim_controller
|
||||||
|
|
||||||
def on_post(self, req, resp, project_id, queue_name):
|
def on_post(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Claims collection POST - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
# Check for an explicit limit on the # of messages to claim
|
# Check for an explicit limit on the # of messages to claim
|
||||||
limit = req.get_param_as_int('limit')
|
limit = req.get_param_as_int('limit')
|
||||||
claim_options = {} if limit is None else {'limit': limit}
|
claim_options = {} if limit is None else {'limit': limit}
|
||||||
@ -87,6 +90,11 @@ class ItemResource(object):
|
|||||||
self.claim_controller = claim_controller
|
self.claim_controller = claim_controller
|
||||||
|
|
||||||
def on_get(self, req, resp, project_id, queue_name, claim_id):
|
def on_get(self, req, resp, project_id, queue_name, claim_id):
|
||||||
|
LOG.debug(_("Claim item GET - claim: %(claim_id)s, "
|
||||||
|
"queue: %(queue_name)s, project: %(project_id)s") %
|
||||||
|
{"queue_name": queue_name,
|
||||||
|
"project_id": project_id,
|
||||||
|
"claim_id": claim_id})
|
||||||
try:
|
try:
|
||||||
meta, msgs = self.claim_controller.get(
|
meta, msgs = self.claim_controller.get(
|
||||||
queue_name,
|
queue_name,
|
||||||
@ -119,6 +127,11 @@ class ItemResource(object):
|
|||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
def on_patch(self, req, resp, project_id, queue_name, claim_id):
|
def on_patch(self, req, resp, project_id, queue_name, claim_id):
|
||||||
|
LOG.debug(_("Claim Item PATCH - claim: %(claim_id)s, "
|
||||||
|
"queue: %(queue_name)s, project:%(project_id)s") %
|
||||||
|
{"queue_name": queue_name,
|
||||||
|
"project_id": project_id,
|
||||||
|
"claim_id": claim_id})
|
||||||
# Read claim metadata (e.g., TTL) and raise appropriate
|
# Read claim metadata (e.g., TTL) and raise appropriate
|
||||||
# HTTP errors as needed.
|
# HTTP errors as needed.
|
||||||
metadata, = wsgi_helpers.filter_stream(req.stream, req.content_length,
|
metadata, = wsgi_helpers.filter_stream(req.stream, req.content_length,
|
||||||
@ -140,6 +153,11 @@ class ItemResource(object):
|
|||||||
raise wsgi_exceptions.HTTPServiceUnavailable(description)
|
raise wsgi_exceptions.HTTPServiceUnavailable(description)
|
||||||
|
|
||||||
def on_delete(self, req, resp, project_id, queue_name, claim_id):
|
def on_delete(self, req, resp, project_id, queue_name, claim_id):
|
||||||
|
LOG.debug(_("Claim item DELETE - claim: %(claim_id)s, "
|
||||||
|
"queue: %(queue_name)s, project: %(project_id)s") %
|
||||||
|
{"queue_name": queue_name,
|
||||||
|
"project_id": project_id,
|
||||||
|
"claim_id": claim_id})
|
||||||
try:
|
try:
|
||||||
self.claim_controller.delete(queue_name,
|
self.claim_controller.delete(queue_name,
|
||||||
claim_id=claim_id,
|
claim_id=claim_id,
|
||||||
|
@ -128,6 +128,10 @@ class CollectionResource(object):
|
|||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
def on_post(self, req, resp, project_id, queue_name):
|
def on_post(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Messages collection POST - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
|
|
||||||
uuid = req.get_header('Client-ID', required=True)
|
uuid = req.get_header('Client-ID', required=True)
|
||||||
|
|
||||||
# Pull out just the fields we care about
|
# Pull out just the fields we care about
|
||||||
@ -187,6 +191,10 @@ class CollectionResource(object):
|
|||||||
resp.body = helpers.to_json(body)
|
resp.body = helpers.to_json(body)
|
||||||
|
|
||||||
def on_get(self, req, resp, project_id, queue_name):
|
def on_get(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Messages collection GET - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
|
|
||||||
resp.content_location = req.relative_uri
|
resp.content_location = req.relative_uri
|
||||||
|
|
||||||
ids = req.get_param_as_list('ids')
|
ids = req.get_param_as_list('ids')
|
||||||
@ -211,6 +219,11 @@ class ItemResource(object):
|
|||||||
self.message_controller = message_controller
|
self.message_controller = message_controller
|
||||||
|
|
||||||
def on_get(self, req, resp, project_id, queue_name, message_id):
|
def on_get(self, req, resp, project_id, queue_name, message_id):
|
||||||
|
LOG.debug(_("Messages item GET - message: %(message)s, "
|
||||||
|
"queue: %(queue)s, project: %(project)s") %
|
||||||
|
{"message": message_id,
|
||||||
|
"queue": queue_name,
|
||||||
|
"project": project_id})
|
||||||
try:
|
try:
|
||||||
messages = self.message_controller.get(
|
messages = self.message_controller.get(
|
||||||
queue_name,
|
queue_name,
|
||||||
@ -239,6 +252,11 @@ class ItemResource(object):
|
|||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
def on_delete(self, req, resp, project_id, queue_name, message_id):
|
def on_delete(self, req, resp, project_id, queue_name, message_id):
|
||||||
|
LOG.debug(_("Messages item DELETE - message: %(message)s, "
|
||||||
|
"queue: %(queue)s, project: %(project)s") %
|
||||||
|
{"message": message_id,
|
||||||
|
"queue": queue_name,
|
||||||
|
"project": project_id})
|
||||||
try:
|
try:
|
||||||
self.message_controller.delete(
|
self.message_controller.delete(
|
||||||
queue_name,
|
queue_name,
|
||||||
|
@ -53,6 +53,9 @@ class ItemResource(object):
|
|||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
def on_put(self, req, resp, project_id, queue_name):
|
def on_put(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Queue item PUT - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
# TODO(kgriffs): Migrate this check to input validator middleware
|
# TODO(kgriffs): Migrate this check to input validator middleware
|
||||||
if req.content_length > transport.MAX_QUEUE_METADATA_SIZE:
|
if req.content_length > transport.MAX_QUEUE_METADATA_SIZE:
|
||||||
description = _('Queue metadata size is too large.')
|
description = _('Queue metadata size is too large.')
|
||||||
@ -90,6 +93,9 @@ class ItemResource(object):
|
|||||||
resp.location = req.path
|
resp.location = req.path
|
||||||
|
|
||||||
def on_get(self, req, resp, project_id, queue_name):
|
def on_get(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Queue item GET - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
message_ids = req.get_param_as_list('ids')
|
message_ids = req.get_param_as_list('ids')
|
||||||
if message_ids is None:
|
if message_ids is None:
|
||||||
doc = self._get_metadata(project_id, queue_name)
|
doc = self._get_metadata(project_id, queue_name)
|
||||||
@ -102,6 +108,9 @@ class ItemResource(object):
|
|||||||
resp.body = helpers.to_json(doc)
|
resp.body = helpers.to_json(doc)
|
||||||
|
|
||||||
def on_delete(self, req, resp, project_id, queue_name):
|
def on_delete(self, req, resp, project_id, queue_name):
|
||||||
|
LOG.debug(_("Queue item DELETE - queue: %(queue)s, "
|
||||||
|
"project: %(project)s") %
|
||||||
|
{"queue": queue_name, "project": project_id})
|
||||||
try:
|
try:
|
||||||
self.queue_controller.delete(queue_name, project=project_id)
|
self.queue_controller.delete(queue_name, project=project_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user