Merge "Don't log each received messages"
This commit is contained in:
commit
f31f519e15
@ -32,6 +32,7 @@ import six
|
||||
from oslo.config import cfg
|
||||
from oslo.messaging._drivers import common as rpc_common
|
||||
from oslo.messaging._drivers import pool
|
||||
from oslo.utils import strutils
|
||||
|
||||
amqp_opts = [
|
||||
cfg.BoolOpt('amqp_durable_queues',
|
||||
@ -164,7 +165,8 @@ def unpack_context(conf, msg):
|
||||
context_dict['reply_q'] = msg.pop('_reply_q', None)
|
||||
context_dict['conf'] = conf
|
||||
ctx = RpcContext.from_dict(context_dict)
|
||||
rpc_common._safe_log(LOG.debug, 'unpacked context: %s', ctx.to_dict())
|
||||
LOG.debug(u'unpacked context: %s',
|
||||
strutils.mask_password(six.text_type(ctx.to_dict())))
|
||||
return ctx
|
||||
|
||||
|
||||
|
@ -96,11 +96,14 @@ class AMQPListener(base.Listener):
|
||||
self._stopped = threading.Event()
|
||||
|
||||
def __call__(self, message):
|
||||
# FIXME(markmc): logging isn't driver specific
|
||||
rpc_common._safe_log(LOG.debug, 'received %s', dict(message))
|
||||
ctxt = rpc_amqp.unpack_context(self.conf, message)
|
||||
|
||||
# FIXME(sileht): Don't log the message until strutils is more
|
||||
# efficient, (rpc_amqp.unpack_context already log the context)
|
||||
# LOG.debug(u'received: %s',
|
||||
# strutils.mask_password(six.text_type(dict(message))))
|
||||
|
||||
unique_id = self.msg_id_cache.check_duplicate_message(message)
|
||||
ctxt = rpc_amqp.unpack_context(self.conf, message)
|
||||
|
||||
self.incoming.append(AMQPIncomingMessage(self,
|
||||
ctxt.to_dict(),
|
||||
|
@ -27,7 +27,6 @@ from oslo import messaging
|
||||
from oslo.messaging._i18n import _
|
||||
from oslo.messaging import _utils as utils
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import strutils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -161,11 +160,6 @@ class Connection(object):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def _safe_log(log_func, msg, msg_data):
|
||||
"""Sanitizes the msg_data field before logging."""
|
||||
return log_func(msg, strutils.mask_password(six.text_type(msg_data)))
|
||||
|
||||
|
||||
def serialize_remote_exception(failure_info, log_failure=True):
|
||||
"""Prepares exception data to be sent over rpc.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user