title: How to get detailed log/info about rabbitmq connection action?
body: <p>I have a python program connecting to a rabbitmq server. When this program starts, it connects well. But when rabbitmq server restarts, my program can not reconnect to it, and leaving error just "Socket closed"(produced by kombu), which is meaningless.</p>
  
  <p>I want to know the detailed info about the connection failure. On the server side, there is nothing useful in the rabbitmq log file either, it just said "connection failed" with no reason given.</p>
  
  <p>I tried the trace plugin(<a href="https://www.rabbitmq.com/firehose.html" rel="noreferrer">https://www.rabbitmq.com/firehose.html</a>), and found there was no trace info published to amq.rabbitmq.trace exchange when the connection failure happended. I enabled the plugin with:</p>
  
  <pre><code>rabbitmq-plugins enable rabbitmq_tracing
  systemctl restart rabbitmq-server
  rabbitmqctl trace_on
  </code></pre>
  
  <p>and then i wrote a client to get message from amq.rabbitmq.trace exchange:</p>
  
  <pre><code>#!/bin/env python
  from kombu.connection import BrokerConnection
  from kombu.messaging import Exchange, Queue, Consumer, Producer
  
  def on_message(self, body, message):
      print("RECEIVED MESSAGE: %r" % (body, ))
      message.ack()
  
  def main():
      conn = BrokerConnection('amqp://admin:pass@localhost:5672//')
      channel = conn.channel()
      queue = Queue('debug', channel=channel,durable=False)
      queue.bind_to(exchange='amq.rabbitmq.trace', routing_key='publish.amq.rabbitmq.trace')
      consumer = Consumer(channel, queue)
      consumer.register_callback(on_message)
      consumer.consume()
      while True:
          conn.drain_events()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I also tried to get some debug log from rabbitmq server. I reconfigured rabbitmq.config according to <a href="https://www.rabbitmq.com/configure.html" rel="noreferrer">https://www.rabbitmq.com/configure.html</a>, and set 
  log_levels to</p>
  
  <pre><code>{log_levels, [{connection, info}]}
  </code></pre>
  
  <p>but as a result rabbitmq server failed to start. It seems like the official doc is not for me, my rabbitmq server version is 3.3.5. However</p>
  
  <pre><code>{log_levels, [connection,debug,info,error]}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{log_levels, [connection,debug]}
  </code></pre>
  
  <p>works, but with this there is no DEBUG info showing in the logs, which i don't know whether it is because the log_levels configuration is not effective or there is just no DEBUG log got printed all the time.</p>