Skip to content

Commit a08fe75

Browse files
authored
Update 26.2.1 Color-coded output.md
1 parent 2df2b69 commit a08fe75

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
### 26.2.1 Color-coded输出
2-
如果你的终端支持ANSI,Spring Boot将使用不同颜色输出日志以便争强可读性(color output)。
2+
如果你的终端支持ANSI,Spring Boot将使用彩色编码(color output)输出日志以增强可读性,你可以将`spring.output.ansi.enabled`设置为一个[支持的值](http://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/api/org/springframework/boot/ansi/AnsiOutput.Enabled.html)来覆盖默认设置。
3+
4+
彩色编码(Color coding)使用`%clr`表达式进行配置,在其最简单的形式中,转换器会根据日志级别使用不同的颜色输出日志,例如:
5+
```java
6+
%clr(%5p)
7+
```
8+
日志级别到颜色的映射如下:
9+
|Level|Color|
10+
|---|---|
11+
|`FATAL`|Red|
12+
|`ERROR`|Red|
13+
|`WARN`|Yellow|
14+
|`INFO`|Green|
15+
|`DEBUG`|Green|
16+
|`TRACE`|Green|
17+
18+
另外,
19+
20+

0 commit comments

Comments
 (0)