Skip to main content


By default, ActiveMQ uses slf4j as an abstraction facade for various logging frameworks. Log4j is the default framework provided in ActiveMQ. In this article, we will cover how to quickly increase the logging information you can get from your broker in the most common scenarios using the provided out-of-the-box configuration.

Global Configuration

%ACTIVE_MQ_HOME%/conf/ is the main file where you can update your broker logging configuration. By default, the root logger is the following:

log4j.rootLogger=INFO, console, logfile

# Console appender
log4j.appender.console.layout.ConversionPattern=%5p | %m%n

# File appender
log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n%throwable{full}

Root Logger

The first line from [1] defines the root logger; the child definitions will inherit its level, appender, and ResourceBundle. The child application logging definition can define wider or narrower levels.  For example, if you want to enable debug level logging for the entire broker, you can:

Comment out:

# log4j.rootLogger=INFO, console, logfile

And uncomment the following line:

log4j.rootLogger=DEBUG, console, logfile

The above change will increase the broker login considerably in your File appender target to %ACTIVE_MQ_HOME%/data/activemq.log with DEBUG level messages. Notice the console appender will still be logging INFO level only information since it has the threshold set to INFO: og4j.appender.console.threshold=INFO


Child loggers for login connection data only

A common question ActiveMQ brokers administrators get is about consumer or producer connections. Enabling connection-only related data can be archived without setting DEBUG level on Root Logger.

To enable Transport and Connection related logging, you just need to add the following line to an out-of-the-box %ACTIVE_MQ_HOME%/conf/ file:

The following is an example of log information generated when a producer ( sends a message to the broker ( You can now see specific information related to when the new connection and transport were set and stopped:

2022-09-12 13:07:36,309 | DEBUG | Setting up new connection id:, address: tcp://, info: ConnectionInfo {commandId = 1, responseRequired = true, connectionId =, clientId =, clientIp = null, userName = null, password = *****, brokerPath = null, brokerMasterConnector = false, manageable = true, clientMaster = true, faultTolerant = true, failoverReconnect = false} | | ActiveMQ Transport: tcp:///
2022-09-12 13:07:36,371 | DEBUG | remove connection id: | | ActiveMQ Transport: tcp:///
2022-09-12 13:07:36,372 | DEBUG | Stopping connection: tcp:// | | ActiveMQ BrokerService[localhost] Task-7
2022-09-12 13:07:36,374 | DEBUG | Stopped transport: tcp:// | | ActiveMQ BrokerService[localhost] Task-7
2022-09-12 13:07:36,374 | DEBUG | Connection Stopped: tcp:// | | ActiveMQ BrokerService[localhost] Task-7

Similar data can be viewed temporarily in the ActiveMQ web console admin/network.jsp, but enabling broker Transport and Connection logging will persist the information in the activemq.log file for further analysis.

Live logging configuration Reload

The logging configuration is reloaded after each Broker restart. ActiveMQ documentation shows how to apply live reloading using JMX tools such as Jconsole. But in the cases when you don’t have a JMX setup at hand, an HTTP request to reload the logging configuration may be a better fit.

Since ActiveMQ 5.8.0, the Jolokia JMX-HTTP bridge is bundled by default. The following HTTP request provides live logging configuration reloading to an ActiveMQ broker, you may need to replace user, password, and broker URL accordingly.:

curl -H "Origin: http://localhost" -u user:password\=Broker,brokerName\=localhost,service\=Log4JConfiguration/reloadLog4jProperties

Successful reply by jolokia api indicating the logging configuration reload was successfull:


Audit logs

These logs provide you information about every management action done in your broker, either via JMX or Web Console management interface. Audit logs are disabled by default, but their configuration is arleady provided in %ACTIVE_MQ_HOME%/conf/ file:, audit
log4j.appender.audit.layout.ConversionPattern=%-5p | %m | %t%n

To enable audit logs in your broker and have all the related information written in
%ACTIVE_MQ_HOME%/data/audit.log file, you need to uncomment the following line in %ACTIVE_MQ_HOME%/bin/env file:

ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS -Dorg.apache.activemq.audit=true"

The following is an example of the information available in the audit log as a result of a JMX logging property live reloading and a JMS queue purge called

INFO  | admin requested /admin/purgeDestination.action [JMSDestination='[]' JMSDestinationType='[queue]' secret='[daappkddb24j]' ] from at 12-09-2022 15:06:55,590 | qtp1429483328-42
INFO  | anonymous called[] on localhost at 12-09-2022 15:07:03,025 | qtp1429483328-36


Adjusting your ActiveMQ logging for monitoring, troubleshooting, or testing purposes is a straightforward process. For more fine-grain details on configuring log4j, you can check the official manual, for more information about ActiveMQ logging, check out the FAQ section.

Cesar Hernandez

Cesar Hernandez

César Hernández is a Senior Software Engineer at Tomitribe with experience in Enterprise Java Applications. He is a Java Champion, Duke's Choice Award winner, Eclipse Committer, Open Source advocate, teacher, and public speaker. When César is away from a computer, he enjoys spending time with his family, traveling and playing music with the Java Community Band, The Null Pointers. Follow Cesar on twitter @CesarHgt

Leave a Reply