Issue Type: Improvement Improvement
Affects Versions: 1.1.2
Assignee: Logback dev list
Components: logback-classic
Created: 01/Aug/14 3:58 AM
Description:

If you want the default value of a MDC lookup to be the result of a different MDC lookup (or any other variable/substitution) it does not work.

%X{mdcKey:-%X{defaultKey}} should be allowed. Instead if %X{mdcKey} is not defined the log output is the literal string "%X{defaultKey}" instead of performing an MDC lookup on the defaultKey.

For example, we are trying to use the following pattern.

<encoder>
    <pattern>%d{ISO8601} %-5level [%thread] [%X{signature}:%c{0}] %msg%n</pattern>
</encoder>

However, %c{0} is never parsed or turned into the name of the logger.

Best I can tell from looking at the code the default value of a MDC token is never parsed.

Project: logback
Priority: Major Major
Reporter: Tim Evers
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
logback-dev mailing list
logback-dev@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-dev

Reply via email to