How to Simple configuration the Log in Spring Boot

When building a project using https://start.spring.io the template provided by [Spring Start], the dependencies required for logging are already built into it. To use logs, all you need is a simple configuration.

Open the project’s applications.yaml file and add the appropriate configuration options to it. as:

1
2
3
4
5
6
7
8
9
logging:
level:
root: WARN
org:
springframework:
web: DEBUG
info:
mlstech:
api: DEBUG

In the above settings, the overall log base is set to WARN, and the log level of different packages is set according to the needs of development and debugging.

本文标题:How to Simple configuration the Log in Spring Boot

文章作者:Morning Star

发布时间:2022年01月20日 - 16:01

最后更新:2022年01月20日 - 16:01

原始链接:https://www.mls-tech.info/java/spring-boot-setup-simple-log/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。