As of version 5.5.0, ActiveMQ uses slf4j as the logging framework. This allows us to support MDC logging.
See more details about MDC logging in the logback manual.

Currently ActiveMQ add three pieces of information to the diagnostic context:



Name of the broker logging event


Address of the connector which is serving the request


Name of the target destination of a message

For example if you use log format like

log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{} %-20.20X{activemq.connector} %-20.20X{activemq.destination} - %m%n

in an environment where multiple brokers use the same log (like unit tests), you can expect the output similar to this one

2011-03-23 13:51:04,919 [] - TRACE Queue                          - broker-3B  tcp://localhost:6111                      - Message ID:dejan-bosanacs-macbook-pro....
2011-03-23 13:51:04,935 [oker-3B] Task-1] - DEBUG Queue                          - broker-3B  tcp://localhost:6111 PROD.FUSESOURCE.3.B  - PROD.FUSESOURCE.3.B toPageIn: 1, Inflight...
2011-03-23 13:51:04,763 [oker-2A] Task-1] - TRACE AbstractStoreCursor            - broker-2A  vm://broker-2A       PROD.FUSESOURCE.3.B  - QueueStorePrefetch611939300 - fillBatch
2011-03-23 13:51:04,759 [] - TRACE Queue                          - broker-3A  tcp://localhost:6110                      - Message ID:dejan-bosanacs-macbook-pro.l...
2011-03-23 13:51:04,937 [oker-2A] Task-1] - TRACE NetworkBridgeFilter            - broker-2A  vm://broker-2A       PROD.FUSESOURCE.3.B  - Message all ready routed once through t...
2011-03-23 13:51:04,936 [oker-3B] Task-1] - TRACE AbstractStoreCursor            - broker-3B  tcp://localhost:6111 PROD.FUSESOURCE.3.B  - QueueStorePrefetch2047424752 - fillBatch
2011-03-23 13:51:04,941 [oker-2A] Task-2] - DEBUG DemandForwardingBridgeSupport  - broker-2A                                            - bridging (broker-2A -> broker-1B, consu...

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram