解决方法是排除spring-boot-starter-web中的slf4j-log4j12包
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId></exclusion></exclusions>
</dependency>
此方法来源于springboot 关于 Class path contains multiple SLF4J bindings.警告的解决_Java_凌大大的博客-CSDN博客如果仍存在可能是其他包中也引用来该包,具体排查方法见其博客