编程语言
首页 > 编程语言> > 运行程序报错:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".解决方案

运行程序报错: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.

解决方案:
1)首先看看你工程中的sl4j-api的版本(比如我的是1.7.25)

2)然后在http://mvnrepository.com/搜索slf4j-log4j12,会出现SLF4J LOG4J 12 Binding,点击进入,会有很多版本的slf4j-log4j12,我们点击1.7.25版本的slf4j-log4j12进入详细信息页面,查看依赖的log4j

点击: 1.2.27

完美解决问题:
maven项目的 pom.xml安装依赖:

<dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.25</version>
        </dependency>
    </dependencies>

转载:https://blog.csdn.net/langtian08/article/details/82015017

标签:load,25,1.7,StaticLoggerBinder,SLF4J,slf4j,报错,org,log4j12
来源: https://www.cnblogs.com/nanao/p/15421937.html