Log4j线程在记录时被阻塞

时间:2018-12-27 17:15:15

标签: spring spring-boot log4j

我正在运行Spring Boot应用程序jar。它可以正常运行一段时间,然后突然停止。在执行threadDump时,我看到两个线程在尝试登录时处于 BLOCKED 状态。

"pool-4-thread-1" #26 prio=5 os_prio=0 tid=0x00007f91e1f2b000 nid=0xdbd0 waiting for monitor entry [0x00007f91de9f3000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.apache.logging.log4j.core.layout.TextEncoderHelper.copyDataToDestination(TextEncoderHelper.java:62)
        - waiting to lock <0x00000005d056bbf8> (a org.apache.logging.log4j.core.appender.OutputStreamManager)
        at org.apache.logging.log4j.core.layout.TextEncoderHelper.encodeTextWithCopy(TextEncoderHelper.java:57)
        at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encodeWithThreadLocals(StringBuilderEncoder.java:70)
        at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:63)
        at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:32)
        at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:182)
        at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:57)
        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:120)
        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:113)
        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:104)
        at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:155)
        at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:128)
        at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:119)
        at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
        at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:390)
        at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:375)
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:359)
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:349)
        at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
        at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
        at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2005)
        at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1876)
        at org.apache.logging.slf4j.Log4jLogger.info(Log4jLogger.java:184)

0 个答案:

没有答案