springboot之logback配置

参考了https://blog.csdn.net/hxtxgfzs/article/details/79488163

Spring Boot默认情况下,当使用"Starters" 使用Logback输出日志
Spring Boot默认配置只会输出到控制台,并不会记录到文件中,但是我们通常生产环境使用时都需要以文件方式记录。

日志配置参数

logging:
file: # 日志文件,绝对路径或相对路径
path: # 保存日志文件目录路径
config: # 日志配置文件,Spring Boot默认使用classpath路径下的日志配置文件,如:logback.xml
level: # 日志级别
org.springframework.web: DEBUG # 配置spring web日志级别
PS:Spring Boot中的logging.path和logging.file这2个属性,只需要配置其中之一即可,如果同时配置,则使用logging.file属性。
---------------------
作者:hxtxgfzs
来源:CSDN
原文:https://blog.csdn.net/hxtxgfzs/article/details/79488163
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/heroinss/p/10553233.html