Add a info log when a reconnection occurs

This change adds a info log when a reconnection occurs
like we have before.

Change-Id: I3b7d86894efac09e27125c368fc83e83c36b630e
This commit is contained in:
Mehdi Abaakouk 2014-12-02 15:48:34 +01:00
parent f31f519e15
commit 31a149a4df
1 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,7 @@ from oslo.messaging._drivers import amqp as rpc_amqp
from oslo.messaging._drivers import amqpdriver
from oslo.messaging._drivers import common as rpc_common
from oslo.messaging._i18n import _
from oslo.messaging._i18n import _LI
from oslo.messaging import exceptions
from oslo.utils import netutils
@ -504,13 +505,13 @@ class Connection(object):
self._url, ssl=self._ssl_params, login_method=self._login_method,
failover_strategy="shuffle")
LOG.info(_('Connecting to AMQP server on %(hostname)s:%(port)d'),
LOG.info(_LI('Connecting to AMQP server on %(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
# NOTE(sileht): just ensure the connection is setuped at startup
self.ensure(error_callback=None,
method=lambda channel: True)
LOG.info(_('Connected to AMQP server on %(hostname)s:%(port)d'),
LOG.info(_LI('Connected to AMQP server on %(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
@ -632,6 +633,11 @@ class Connection(object):
for consumer in self.consumers:
consumer.reconnect(new_channel)
LOG.info(_LI('Reconnected to AMQP server on '
'%(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
recoverable_errors = (self.connection.recoverable_channel_errors +
self.connection.recoverable_connection_errors)
try: