[
https://issues.apache.org/jira/browse/LOG4J2-418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oliver Flege updated LOG4J2-418:
--------------------------------
Attachment: (was: log4j2-418.patch)
> Support default value for missing key in map-based pattern
> ----------------------------------------------------------
>
> Key: LOG4J2-418
> URL: https://issues.apache.org/jira/browse/LOG4J2-418
> Project: Log4j 2
> Issue Type: Improvement
> Reporter: Oliver Flege
> Priority: Minor
>
> %X{key} and %K{key} render the value found for key in the thread context map
> or MapMessage, respectively. If the key is not contained in the map, the
> pattern evaluates to "" (empty string).
> A default value for missing values can currently only be defined by using
> $${ctx:key} and defining a property named "key" with the desired default
> value. Drawbacks: ${ctx:key} has to be parsed and evaluated for each message
> and the pattern does not support conversion specifiers (for alignment, fixed
> width, etc).
> The proposed improvement would be to support an optional default value that
> can be specified in the pattern, e.g. %X{key:-defaultValue}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]