blob: 21a54dfbee1ff8499ea1e65807231c95b9478de9 [file] [log] [blame]
<div class="wiki-content maincontent"><p>ActiveMQ uses <a shape="rect" href="http://www.slf4j.org/">slf4j</a> as its logging framework. This allows ActiveMQ to support <a shape="rect" href="http://www.slf4j.org/api/org/slf4j/MDC.html">MDC logging</a>. For more information about about MDC logging see the <a shape="rect" href="http://logback.qos.ch/manual/mdc.html">logback manual</a>.</p><p>Currently ActiveMQ adds three keys to the diagnostic context:</p><table><tbody><tr><th colspan="1" rowspan="1"><p>Key</p></th><th colspan="1" rowspan="1"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>activemq.broker</code></p></td><td colspan="1" rowspan="1"><p>Name of the broker logging event.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>activemq.connector</code></p></td><td colspan="1" rowspan="1"><p>Address of the connector which is serving the request.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>activemq.destination</code></p></td><td colspan="1" rowspan="1"><p>Name of the target destination of a message.</p></td></tr></tbody></table><p>For example, if you've defined a log appender to use the following <strong><code>ConversionPattern</code></strong>:</p><structured-macro ac:macro-id="01b2beaa-403c-4dc0-80e2-5c22f07d902e" ac:name="code" ac:schema-version="1"><parameter ac:name="language">text</parameter><plain-text-body>log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-20.20X{activemq.destination} - %m%n</plain-text-body></structured-macro><p>then in an environment where multiple brokers use the same log (like unit tests), the log output will take this general form:</p><structured-macro ac:macro-id="3ac0444e-9ea9-4670-9006-edc3618a4bdf" ac:name="code" ac:schema-version="1"><parameter ac:name="language">text</parameter><plain-text-body>2011-03-23 13:51:04,919 [127.0.0.1:58146] - 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 [127.0.0.1:58118] - 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 -&gt; broker-1B, consu...
</plain-text-body></structured-macro></div>