From d5d2ef321b5151d98cf662d6fe4ad12fa3b3c155 Mon Sep 17 00:00:00 2001 From: Alejandro Cabrera Date: Fri, 1 Nov 2013 00:28:30 -0400 Subject: [PATCH] fix: Reduce logging severity of certain errors Here are the proposed changes: - OverflowedJsonInteger: exception -> debug - InvalidJson: exception -> debug - InvalidQueueName: warning -> debug Rationale: these pollute the server logs and provide little value to system operators. Change-Id: Icd73a5bd3fc7d7ef349b18e7e485df8a7dfc0a1a Closes-Bug: #1246977 --- marconi/common/transport/wsgi/helpers.py | 6 +++--- marconi/queues/transport/wsgi/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/marconi/common/transport/wsgi/helpers.py b/marconi/common/transport/wsgi/helpers.py index 9059fe59d..71cd7a5c0 100644 --- a/marconi/common/transport/wsgi/helpers.py +++ b/marconi/common/transport/wsgi/helpers.py @@ -75,9 +75,9 @@ def validate_queue_identification(validate, req, resp, params): project = params['project_id'] queue = params['queue_name'].decode('utf-8', 'replace') - LOG.warn(_(u'Invalid queue name "%(queue)s" submitted for ' - u'project: %(project)s'), - {'queue': queue, 'project': project}) + LOG.debug(_(u'Invalid queue name "%(queue)s" submitted for ' + u'project: %(project)s'), + {'queue': queue, 'project': project}) raise falcon.HTTPBadRequest(_(u'Invalid queue identification'), _(u'The format of the submitted queue ' diff --git a/marconi/queues/transport/wsgi/utils.py b/marconi/queues/transport/wsgi/utils.py index 39cffd24d..ce72e633e 100644 --- a/marconi/queues/transport/wsgi/utils.py +++ b/marconi/queues/transport/wsgi/utils.py @@ -67,12 +67,12 @@ def filter_stream(stream, len, spec=None, doctype=JSONObject): document = utils.read_json(stream, len) except utils.MalformedJSON as ex: - LOG.exception(ex) + LOG.debug(ex) description = _(u'Request body could not be parsed.') raise errors.HTTPBadRequestBody(description) except utils.OverflowedJSONInteger as ex: - LOG.exception(ex) + LOG.debug(ex) description = _(u'JSON contains integer that is too large.') raise errors.HTTPBadRequestBody(description)