修改 pom.xml 的配置
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<!-- 排除 logback -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 引入 log4j2 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
</dependencies>
文章讲述了如何修改SpringBoot项目中的pom.xml文件,将依赖从spring-boot-starter-logging排除,转而引入log4j2作为日志管理工具。具体操作包括更新parent版本到2.0.6.RELEASE,并添加对应的dependency。

2045

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



