Overriding the FILE_LOG_PATTERN (if possible per env)

半世苍凉 提交于 2019-12-22 05:23:34

问题


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



来源:https://stackoverflow.com/questions/26629197/overriding-the-file-log-pattern-if-possible-per-env

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!