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

log4j-to-slf4j should not re-format the result of Message.getFormattedMessage

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.17.0
    • 2.17.1
    • SLF4J Bridge
    • None

    Description

      Both the formatted message result (for the configured MessageFactory) and the parameter array are passed to slf4j, such that slf4j attempts to format the already formatted result:

      https://github.com/apache/logging-log4j2/blob/20f9a97dbe5928c3b5077bcdd2a22ac92e941655/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLogger.java#L226-L256

      Caught a similar issue while reviewing this change, but realized it also applies to the slf4j bridge: https://github.com/apache/logging-log4j2/pull/653#discussion_r775083351

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ckozak Carter Kozak
            ckozak Carter Kozak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment