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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.7
    • Component/s: API
    • Labels:
    • Environment:

      Array length logic causes throw java.lang.ArrayIndexOutOfBoundsException

    • Flags:
      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

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              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