You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Carter Kozak (Jira)" <ji...@apache.org> on 2021/12/23 17:47:00 UTC

[jira] [Resolved] (LOG4J2-3264) MapLookup should lookup MapMessage before properties

     [ https://issues.apache.org/jira/browse/LOG4J2-3264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carter Kozak resolved LOG4J2-3264.
----------------------------------
    Fix Version/s: 2.17.1
       Resolution: Fixed

Please verify and close

> MapLookup should lookup MapMessage before properties
> ----------------------------------------------------
>
>                 Key: LOG4J2-3264
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3264
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: Yanming Zhou
>            Assignee: Carter Kozak
>            Priority: Major
>             Fix For: 2.17.1
>
>
> According to [https://logging.apache.org/log4j/2.x/manual/lookups.html#MapLookup]
> {quote}
> 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. 
> {quote}
> 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]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)