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

java.lang.ArrayIndexOutOfBoundsException in ParameterizedMessage.formatTo(ParameterizedMessage.java:221)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.6.2
    • 2.7
    • API
    • Array length logic causes throw java.lang.ArrayIndexOutOfBoundsException

    • Important

    Description

      This error is reproducible when method fomarTo of the class ParameterizedMessage is invoked.

      This root cause is the method init of same class where is invoked, in the this.indices is initializaded with messagePattern.length() >> 1 run to equals zero because that messagePattern.length() is 1 (string with one character).

      I used File Appender in my XML config and I wrote my code with logger.trace("a").
      My PatternLayout used is pattern="%m" (simplest).

      Attachments

        Activity

          People

            rpopma Remko Popma
            RogerioLLeite Rogério Lecarião Leite
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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