I came across an interesting subject when reading the book "RabbitMQ in Action" by Manning. Apparently it's possible to set up consumers to be able to receive all RabbitMQ logging in real time in the consumer.
I read that RabbitMQ publishes logging to an exchange of type topic
called amq.rabbitmq.log
. Consumers can listen to specific severity levels, for example it can be filtered by setting the routing key to error
, warning
or info
.
My question is; I installed a default RabbitMQ server on my PC, but I couldn't find any exchange called amq.rabbitmq.log
. Only one which could be related is amq.rabbitmq.trace
, but this one is used for events (events like queue.deleted, queue.created, ...), in other words that one is not what I'm looking for.
Can anyone bring clarification to my questions? Why is the amq.rabbitmq.log
exchange not available on a clean RabbitMQ server installation?
citation:
Perhaps when you were listing exchanges using rabbitmqctl you spotted an exchange called amq.rabbitmq.log whose type is topic. RabbitMQ will publish its logs to that exchange using the severity level as a routing key - you'll get error, warning and info. Based on what you learned from the previous chapters you can create a consumer to listen to those logs and react accordingly.