Kevin Smokowski created LOG4J2-2871:
---------------------------------------

             Summary: Remove braces from MDC pattern
                 Key: LOG4J2-2871
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2871
             Project: Log4j 2
          Issue Type: Improvement
          Components: Core
            Reporter: Kevin Smokowski


[https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MdcPatternConverter.java]

I have a requirement in which the entire contents of MDC should be printed in 
the format

name=value,name=value2

MdcPatternConverter will always print like

{name=value,name=value2}

Should MdcPatternConverter be enhanced to be more flexible (start and end 
character could be specified) or should a substring function be implemented?

Calling substring on the output of %X could strip the first and last brace.

replace currently supports regex. Entire contents of MDC can be quite long so I 
am not sure if this is the best solution in terms of performance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to