大部分文章都是说在
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
中去掉 logging,但是启动还是报错,思索 项目还有哪里可能含有,最终去掉 启动器里面的日志添加,正常启动
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter</artifactId>
-
<!-- 去除对默认日志的依赖 -->
-
<exclusions>
-
<exclusion>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-logging</artifactId>
-
</exclusion>
-
</exclusions>
-
</dependency>
2. 添加对 log4j2 的依赖
-
<!-- 添加 log4j2 依赖 -->
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-log4j2</artifactId>
-
</dependency>