Log4j 2
  1. Log4j 2
  2. LOG4J2-651

Log4j 2 throws ArrayIndexOutOfBoundsException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-rc2
    • Component/s: None
    • Labels:
      None

      Description

      Sometimes, logging throws java.lang.ArrayIndexOutOfBoundsException:

      2014-05-23 01:01:37,019 ERROR An exception occurred processing Appender Err java.lang.ArrayIndexOutOfBoundsException: 6
              at org.apache.logging.log4j.core.impl.ThrowableProxy.formatElements(ThrowableProxy.java:269)
              at org.apache.logging.log4j.core.impl.ThrowableProxy.getExtendedStackTrace(ThrowableProxy.java:232)
              at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:72)
              at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36)
              at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:172)
              at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:52)
              at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:45)
              at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:118)
              at org.apache.logging.log4j.core.appender.RollingFileAppender.append(RollingFileAppender.java:85)
              at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97)
              at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.callAppenders(AsyncAppender.java:276)
              at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.run(AsyncAppender.java:239)
      

      Here is configuration:

      <Configuration status="warn">
      
      <Appenders>
          <Async name="Async" bufferSize="2048" blocking="${BLOCKING_LOG}">
              <appender-ref ref="A1"/>
              <appender-ref ref="Err"/>
          </Async>
      
          <Async name="Async-profiler" bufferSize="2048" blocking="${BLOCKING_LOG}">
              <appender-ref ref="Profiler"/>
          </Async>
      
          <RollingFile name="A1" fileName="${GFT_VAR}/log/${target}.log" filePattern="${GFT_VAR}/log/${target}.log.%i">
              <PatternLayout pattern="[%d] [%t] %-5p %c - %m%n"/>
              <DefaultRolloverStrategy max="3"/>
              <Policies>
                  <SizeBasedTriggeringPolicy size="50Mb"/>
              </Policies>
          </RollingFile>
      
          <RollingFile name="Err" fileName="${GFT_VAR}/log/${target}.err" filePattern="${GFT_VAR}/log/${target}.err.%i">
              <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
              <PatternLayout pattern="[%d] [%t] %-5p %c - %m%n"/>
              <DefaultRolloverStrategy max="2"/>
              <Policies>
                  <SizeBasedTriggeringPolicy size="10MB"/>
              </Policies>
          </RollingFile>
      
          <RollingFile name="Profiler" fileName="${GFT_VAR}/log/${target}.stat"
                       filePattern="${GFT_VAR}/log/${target}.stat.%i">
              <PatternLayout pattern="[%d] [%t] %-5p %c - %m%n"/>
              <DefaultRolloverStrategy max="3"/>
              <Policies>
                  <SizeBasedTriggeringPolicy size="10MB"/>
              </Policies>
          </RollingFile>
      
      </Appenders>
      
      <Loggers>
          <Root level="debug">
              <AppenderRef ref="Async"/>
          </Root>
      
          <Logger name="net.sf" level="info">
              <AppenderRef ref="Async"/>
          </Logger>
      
          <Logger name="org.springframework.jdbc.core.JdbcTemplate" level="info">
              <AppenderRef ref="Async"/>
          </Logger>
      
          <Logger name="gft.service.stats.PoolableMetrics" additivity="false" level="info">
              <AppenderRef ref="Async"/>
          </Logger>
      
          <Logger name="gft.util.profiling.Profiler" additivity="false">
              <AppenderRef ref="Async-profiler"/>
          </Logger>
      
      </Loggers>
      
      </Configuration>
      

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Nikita Koval
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development