我想将atomikos日志级别设置为高于INFO。 Tomcat的catalina.out日志文件写入许多INFO消息,导致事务需要很长时间才能完成。

在启动过程中,catalina.out包含:

18:11:51,481  INFO [main] AbstractUserTransactionService:16 - USING com.atomikos.icatch.console_log_level = WARN


在交易期间,以下内容多次写入catalina.out。

18:12:05,072  INFO [http-8080-1] CompositeTransactionImp:16 - registerSynchronization ( com.atomikos.jdbc.AtomikosConnectionProxy$JdbcRequeueSynchronization@7b60ad0 ) for transaction 127.0.0.1.tm0000100018
18:12:05,072  INFO [http-8080-1] AtomikosConnectionProxy:16 - atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc4.Jdbc4Connection@37955233: calling prepareStatement...
18:12:05,073  INFO [http-8080-1] AtomikosConnectionProxy:16 - atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc4.Jdbc4Connection@37955233: isClosed()...
18:12:05,073  INFO [http-8080-1] AtomikosConnectionProxy:16 - atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc4.Jdbc4Connection@37955233: calling getWarnings...
18:12:05,073  INFO [http-8080-1] AtomikosConnectionProxy:16 - atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc4.Jdbc4Connection@37955233: calling clearWarnings...
18:12:05,073  INFO [http-8080-1] AtomikosConnectionProxy:16 - atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc4.Jdbc4Connection@37955233: close()...


我试图在conf / logging.properties中将atomikos级别设置为WARN,但是仍在写入INFO日志。我什至从logging.properties中删除了ConsoleHandler,但仍在写入catalina.out。

在我的webapp目录中,我更新了log4j.xml以包括以下内容,但仍在获取日志。

<logger name="com.atomikos">
    <level value="ERROR"/>
</logger>

最佳答案

在Atomikos 3.7中,设置以下系统属性:

com.atomikos.icatch.console_log_level=WARN


有关Atomikos JTA的所有属性,请参见this link

从Atomikos 3.8开始,通过SLF4j大大提高了与log4j的集成。

configuring the logs

关于tomcat - 从catalina.out禁用atomikos日志记录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14900629/

10-10 13:31