You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Daniel Kirkdorffer (JIRA)" <ji...@apache.org> on 2017/11/29 01:42:00 UTC
[jira] [Created] (LOG4J2-2136) Add support for values in MDC in
JSONLayout KeyValuePairs
Daniel Kirkdorffer created LOG4J2-2136:
------------------------------------------
Summary: Add support for values in MDC in JSONLayout KeyValuePairs
Key: LOG4J2-2136
URL: https://issues.apache.org/jira/browse/LOG4J2-2136
Project: Log4j 2
Issue Type: Improvement
Components: Layouts
Affects Versions: 2.10.0
Reporter: Daniel Kirkdorffer
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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)