覆盖FILE_LOG_PATTERN(如果可能,每个环境都适用) [英] Overriding the FILE_LOG_PATTERN (if possible per env)
问题描述
我想覆盖Spring Boot的默认文件和控制台日志模式,以包括一些自定义MDC字段.
I want to override Spring Boot's default file and console log pattern to include some custom MDC fields.
是否有使用application.properties/yaml
进行更改的简便方法?如果不是这样,这将是一个不错的功能:-)
Is there an easy way to change this using application.properties/yaml
? If not this would be a nice feature :-)
否则,我可能必须复制Boot的/src/main/resources/org/springframework/boot/logging/logback base.xml
和basic.xml
文件.
Otherwise I probably have to copy Boot's /src/main/resources/org/springframework/boot/logging/logback base.xml
and basic.xml
files.
我不认为logback支持包括那些文件和覆盖属性值,还是吗?
I don't think logback supports including those files and overriding property values, or does it?
推荐答案
当前不可行(引导1.2.2).另请参阅功能请求: https://github.com/spring-projects/spring-boot/issues/1788
Currently not possible (Boot 1.2.2). See also feature request: https://github.com/spring-projects/spring-boot/issues/1788
这篇关于覆盖FILE_LOG_PATTERN(如果可能,每个环境都适用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!