如何关闭Atomikos日志记录?

时间:2012-02-09 15:26:08

标签: atomikos

我在Redhat Linux上运行的独立Java应用程序(v1.6)中使用atomikos v3.7.0 TransactionEssentials。一切都过去了并且仍在顺利进行,除了突然之间的原子正在向控制台生产日志。我尝试了很多东西,不确定导致这种情况的原因并且不知道如何控制它。是的,我看过链接(How to set Atomikos to not write to console logs?)),但这对我没用。 java应用程序使用消息驱动的poj和spring的DefaultMessageListenerContainer,监听队列中的消息并更新MySql数据库。当监听器启动时,即使没有收到任何消息且该应用程序应该什么也不做,它会打印出以下日志:

createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000100002
commit() done (by application) of transaction 192.168.252.15.tm0000100002
createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000200002
commit() done (by application) of transaction 192.168.252.15.tm0000200002
createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000300002

现在,当监听器关闭并重新启动时,它还会打印下面的日志,以及上面的日志:

  

协调器192.168.252.15.tm1200000016的本地启发式终止   with state COMMITTING本地启发式终止协调器   192.168.252.15.tm1200100016 with state COMMITTING本地启发式终止协调器192.168.252.15.tm1200100016 with state   提交协调器的本地启发式终止   192.168.252.15.tm1200200016状态COMMITTING本地启发式终止协调器192.168.252.15.tm1200200016与状态   提交协调器的本地启发式终止   192.168.252.15.tm1200300016,状态为COMMITTING

有什么不对吗?我怎么能停止这个?

3 个答案:

答案 0 :(得分:2)

当我切换到slf4j(通过log4j)并使用

时,我能够停止永无止境的日志
<logger name="atomikos">
    <level value="error" />
</logger>

感谢。

答案 1 :(得分:0)

或者,您可以继续使用log4j并指定:log4j.logger.atomikos = ERROR

答案 2 :(得分:0)

在我的情况下,它最有效,因为库存在冲突

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/slf4j-jdk14-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/weld-osgi-bundle-1.0.1-SP3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

我解决了它在pom.xml上留下多个绑定