Spring Boot 2.x 之 Logging

【源起】
最近在看Apollo的源码,发现其all-in-one项目的脚本demo.sh在执行的时候,竟然没有向控制台输出Spring Boot的日志。

我们修改后构建的Fat Jar,在启动时却打印一堆的Spring Boot日志,就试着想了解开源是怎么做到的。

最后发现是Apollo的上述脚本使用的Shell的重定向,跟Spring Boot日志相关的配置关系并不大。

不过在这个过程中还是读到了一篇关于Spring Boot日志配置的博客写的很不错。

https://howtoprogram.xyz/2016/12/23/how-to-configure-logging-in-spring-boot/

https://www.baeldung.com/spring-boot-disable-console-logging

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html

https://www.cnblogs.com/li-zhi-long/p/9481366.html

猜你喜欢

转载自www.cnblogs.com/zyon/p/11235036.html