spring_reference/IV. Spring Boot features/25.2. Console output.md

8 lines
600 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 25.2. 控制台输出
默认的日志配置会在写日志消息时将它们回显到控制台。默认ERROR, WARN和INFO级别的消息会被记录。可以在启动应用时通过`--debug`标识开启控制台的DEBUG级别日志记录。
```shell
$ java -jar myapp.jar --debug
```
如果你的终端支持ANSI为了增加可读性将会使用彩色的日志输出。你可以设置`spring.output.ansi.enabled`为一个[支持的值](http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/api/org/springframework/boot/ansi/AnsiOutput.Enabled.html)来覆盖自动检测。