前言

单元测试报错

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

思路

去官网看了​​操作手册​​ 官网说了这个问题

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“官网解决_bug


SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“官网解决_html_02

原因

缺少jar包

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“官网解决_jar_03

解决

引入slf4j-simple,保险起见jar版本相同

<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.26</version>
<scope>compile</scope>
</dependency>