Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
%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
Attachments
Attachments
Issue Links
- is related to
-
LOG4J2-419 Support default value for missing key in look ups with fallbacking to looking in the properties map
- Closed