Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1914

AsyncLogger and message formatting (ConcurrentModificationException)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.9.1
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      The docs specify that the default for log4j.format.msg.async is false. But we still got the following log4j2 AsyncLogger processing exception. Does it mean that message formatting is async or maybe async up to 2.7 only? Or is this something else? Thank you

      2017-05-18 08:02:44,570 Log4j2-TF-3-AsyncLoggerConfig-2 ERROR An exception occurred processing Appender AppLogFile java.util.ConcurrentModificationException
      at java.util.HashMap$HashIterator.nextNode(Unknown Source)
      at java.util.HashMap$EntryIterator.next(Unknown Source)
      at java.util.HashMap$EntryIterator.next(Unknown Source)
      at org.apache.logging.log4j.message.ParameterFormatter.appendMap(ParameterFormatter.java:569)
      at org.apache.logging.log4j.message.ParameterFormatter.appendPotentiallyRecursiveValue(ParameterFormatter.java:505)
      at org.apache.logging.log4j.message.ParameterFormatter.recursiveDeepToString(ParameterFormatter.java:432)
      at org.apache.logging.log4j.message.ParameterFormatter.formatMessage2(ParameterFormatter.java:189)
      at org.apache.logging.log4j.message.ParameterizedMessage.formatTo(ParameterizedMessage.java:225)
      at org.apache.logging.log4j.core.pattern.MessagePatternConverter.format(MessagePatternConverter.java:117)
      at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38)
      at org.apache.logging.log4j.core.layout.PatternLayout$PatternSerializer.toSerializable(PatternLayout.java:294)
      at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:195)
      at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:180)
      at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:57)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160)
      at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.append(RollingRandomAccessFileAppender.java:104)
      at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
      at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:447)
      at org.apache.logging.log4j.core.async.AsyncLoggerConfig.asyncCallAppenders(AsyncLoggerConfig.java:114)
      at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:112)
      at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:98)
      at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:129)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                remkop@yahoo.com Remko Popma
                Reporter:
                leonfin Leon Finker
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: