ppkarwasz commented on issue #2844:
URL: 
https://github.com/apache/logging-log4j2/issues/2844#issuecomment-2301929799

   > I found that the '%X' in the template is invalid.
   
   Yes, `%<something>` pattern converters are not supported in the values of 
templates.
   You need to use:
   
   * either a [`${...}` property substitution 
expression](https://logging.staged.apache.org/log4j/2.x/manual/json-template-layout.html#property-substitution-in-template)
      ```json
      "traceId": "${ctx:x-my-TraceID}"
      ```
   
   * or the [`pattern` 
resolver](https://logging.staged.apache.org/log4j/2.x/manual/json-template-layout.html#event-template-resolver-pattern):
     ```json
     "traceId": {
       "$resolver": "pattern",
       "pattern": "%X{x-my-TraceID}"
     }
     ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to