Skip to content

Commit 1fa38f1

Browse files
authored
Update 26.5. Custom log configuration.md
1 parent 65d38fe commit 1fa38f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IV. Spring Boot features/26.5. Custom log configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
所有支持的日志系统在解析配置文件时都能获取系统属性的值,具体可以参考`spring-boot.jar`中的默认配置。
3434

35-
**** 如果想在日志属性中使用占位符,你需要使用[Spring Boot的语法])(http://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/reference/htmlsingle/#boot-features-external-config-placeholders-in-properties),而不是底层框架的语法。尤其是使用Logback时,你需要使用`:`作为属性名和默认值的分隔符,而不是`:-`。
35+
**** 如果想在日志属性中使用占位符,你需要使用[Spring Boot的语法](http://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/reference/htmlsingle/#boot-features-external-config-placeholders-in-properties),而不是底层框架的语法。尤其是使用Logback时,你需要使用`:`作为属性名和默认值的分隔符,而不是`:-`
3636

3737
**** 通过覆盖`LOG_LEVEL_PATTERN`(Logback对应`logging.pattern.level`),你可以向日志中添加MDC和其他ad-hoc的内容。例如,将该值设置为`logging.pattern.level=user:%X{user} %5p`,则默认日志格式将包含一个"user"的MDC实体,如果存在的话,比如:
3838
```properties

0 commit comments

Comments
 (0)