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

Backward compatibility with third party subclasses is broken by added constructor argument in ThrowablePatternConverter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.2, 2.11.2
    • 2.12.0
    • Core
    • None

    Description

      In 2.8.2 a new argument, config, was added to the ThrowablePatternConverter constructor without adding a constructor with the original signature specifying a default value. This breaks backwards compatibility with third party subclasses. If no external subclassing was intended, the constructor should have been made package private instead of protected.

      This is not just a theoretical problem. For example, it is annoying when using Spring Boot and wanting to use a newer Log4j2 than the default 2.7 because Spring Boot has its own ExtendedWhitespaceThrowablePatternConverter. The system does not crash but the log gets some NoSuchMethodError exceptions.

      Attachments

        Activity

          People

            Unassigned Unassigned
            waldeinburg Daniel Skovenborg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: