如何在控制台中停止JtaTransactionManager日志消息?

时间:2015-11-13 10:55:52

标签: spring logging jboss jmstemplate

我已将JmsTemplate与Jboss 6.2和HornetQ集成,一切正常。

我添加了

<bean id="messageListener" class="com.poc.services.jmstemplate.Consumer" />

    <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="destination" ref="defaultDestination" />
        <property name="messageListener" ref="messageListener" />
    </bean>

之后,我每隔一秒就会连续收到以下消息

16:07:30,734 DEBUG [org.springframework.transaction.jta.JtaTransactionManager] (jmsContainer-1) Creating new transaction with name [jmsContainer]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
16:07:32,240 DEBUG [org.springframework.transaction.jta.JtaTransactionManager] (jmsContainer-1) Initiating transaction commit

我该怎么做呢?

1 个答案:

答案 0 :(得分:0)

希望它能够奏效。

<!-- Loggers to filter out various class paths -->

<logger name="org.springframework.transaction.jta">
      <level value="OFF"/> 
</logger>

参考:how-to-disable-log4j-logging-from-java-code