Springboot测试的时候报SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".一个解决方案

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-simple的依赖,然后加入依赖后就可以了。

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.25</version>
        </dependency>

下面是我的logback-spring.xml  的配置

下面是我的测试类写法

运行结果

至于顺序为什么会乱,我就不知道了,求各位大佬指点。

猜你喜欢

转载自blog.csdn.net/qq_32003379/article/details/83415706