Overriding the FILE_LOG_PATTERN (if possible per e

2019-04-29 04:55发布

问题:

I want to override Spring Boot's default file and console log pattern to include some custom MDC fields.

Is there an easy way to change this using application.properties/yaml? If not this would be a nice feature :-)

Otherwise I probably have to copy Boot's /src/main/resources/org/springframework/boot/logging/logback base.xml and basic.xml files.

I don't think logback supports including those files and overriding property values, or does it?

回答1:

Currently not possible (Boot 1.2.2). See also feature request: https://github.com/spring-projects/spring-boot/issues/1788