其他分享
首页 > 其他分享> > SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“. SLF4J: Defaulting to no-operation

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“. SLF4J: Defaulting to no-operation

作者:互联网

出现这个问题是因为缺少 slf4j 或者版本之间不对应

在maven中的pom.xml文件中进行配置

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>2.0.0-alpha0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.0-alpha0</version>
        </dependency>


        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <version>1.7.25</version>
            <scope>compile</scope>
        </dependency>

配置好这个四件套应该就没有问题了

还是不行的话可以去maven官网自己找一套 https://mvnrepository.com/artifact/org.slf4j

官网里面找的要注意把  <scope>test</scope>  改为  <scope>compile</scope>

标签:load,alpha0,StaticLoggerBinder,slf4j,compile,SLF4J,org,2.0,log4j
来源: https://blog.csdn.net/weixin_46389691/article/details/121772383