Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Information Provided
-
2.10.0
-
None
Description
The new KeyValuePair within JSONLayout as implemented for https://issues.apache.org/jira/browse/LOG4J2-1694 doesn't provide support for MDC stored values.
In PatternLayout one can do something like this:
<Pattern>%d{ISO8601}{UTC} %d{Z}{UTC} [CID:%X{conversation-id}] [%t] %-5p %c{1.} - %m%n</Pattern>
But it seems that
<KeyValuePair key="CID" value="%X{conversation-id}"/>
or even
<KeyValuePair key="CID" value="${conversation-id}"/>
doesn't work.
Variable replacement doesn't appear to read from the MDC.