2
votes

In my spring-boot project I am using Logback-"Mapped Diagnostic Context" MDC for logging diagnostic context.

MDC-data is not logged (to console or file) by default.

Is there a way for getting this MDC logs into the output-log, using only application properties?

1

1 Answers

6
votes

spring-boot provides some application properties for this. Have a look at common-application-properties.html.

You can find logging.pattern.level here. By setting

logging.pattern.level=%5p %mdc

data from MDC will be logged, too.