<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
springboot使用它来做日志功能:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> <version>2.1.8.RELEASE</version> <scope>compile</scope> </dependency>
springboot底层使用slf4j+logback的方式进行日志记录,把其他的日志都转换成了slf4j,使用了中间转换包。
springboot能自动适配所有的日志,而且底层使用slf4j+logback的方式记录日志,引入其他框架的时候,只需要把这个框架依赖的日志框架排除掉。



springboot底层依赖关系





本文介绍SpringBoot中如何使用spring-boot-starter-logging进行日志配置,通过slf4j与logback实现日志记录,以及如何排除其他框架的日志依赖。
2387

被折叠的 条评论
为什么被折叠?



