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 06:57:01 UTC
[jira] [Closed] (LOG4J2-2136) Add support for values in MDC in
JSONLayout KeyValuePairs
[ https://issues.apache.org/jira/browse/LOG4J2-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kirkdorffer closed LOG4J2-2136.
--------------------------------------
Resolution: Information Provided
> 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
> Labels: extra-field, json, mdc
>
> 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:
> {code}
> <Pattern>%d{ISO8601}{UTC} %d{Z}{UTC} [CID:%X{conversation-id}] [%t] %-5p %c{1.} - %m%n</Pattern>
> {code}
> But it seems that
> {code}
> <KeyValuePair key="CID" value="%X{conversation-id}"/>
> {code}
> or even
> {code}
> <KeyValuePair key="CID" value="${conversation-id}"/>
> {code}
> doesn't work.
> Variable replacement doesn't appear to read from the MDC.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)