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

MapLookup should lookup MapMessage before properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.1
    • None
    • None

    Description

      According to https://logging.apache.org/log4j/2.x/manual/lookups.html#MapLookup

      Note that when used this way a value for "type" should be declared in the properties declaration to provide a default value in case the message is not a MapMessage or the MapMessage does not contain the key.

      If "type" is present with a MapMessage, then it will be picked not default value in the properties declaration, but the code show that the default value is always picked.
      https://github.com/apache/logging-log4j2/blob/20f9a97dbe5928c3b5077bcdd2a22ac92e941655/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MapLookup.java#L89-L104

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: