layout: default_md title: Logging Interceptor title-class: page-title-activemq5 type: activemq5

Features > Interceptors > Logging Interceptor

Logging Interceptor

The Logging Interceptor is a pretty trivial Interceptor which just logs to Jakarta Commons Logging or log4j as messages are sent or acknowledged on a broker.

The default logging level used is INFO. If you want to increase/reduce the logging you can use change it via commons logging or log4j.

As of version 5.3 the logging Interceptor is more configurable. The idea is to log all events but be able to turn off logging for certain event groups by configuration.

Currently the following groups are supported:

AttributeDescriptionDefault Value
logAllLog all Eventsfalse
logConnectionEventsEvents related to connections and sessionstrue
logTransactionEventsEvents related to transaction handlingfalse
logConsumerEventsEvents related to consuming messagesfalse
logProducerEventsEvents related to producing messagesfalse
logInternalEventsEvents normally not of Interest for users like failover, querying internal objects etcfalse
logSessionEventsEvents related to adding and removing sessionstrue

Only connection events logging is enabled by default.

You can enable the logging interceptor using the following XML configuration. This example enables all logging and disables the connection event logging:

<beans 
  xmlns="http://www.springframework.org/schema/beans" 
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <broker useJmx="false" persistent="false" xmlns="http://activemq.apache.org/schema/core">
    <plugins>
    
      <!-- lets enable detailed logging in the broker but ignore ConnectionEvents -->
      <loggingBrokerPlugin logAll="true" logConnectionEvents="false"/>
      
      <timeStampingBrokerPlugin zeroExpirationOverride="1000" ttlCeiling="60000" futureOnly="true"/>    
      <traceBrokerPathPlugin/>
      
    </plugins>
  </broker>
</beans>