运行程序报错: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)
运行程序报错:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".解决方案

2)然后在http://mvnrepository.com/搜索slf4j-log4j12,会出现SLF4J LOG4J 12 Binding,点击进入,会有很多版本的slf4j-log4j12,我们点击1.7.25版本的slf4j-log4j12进入详细信息页面,查看依赖的log4j
运行程序报错:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".解决方案

点击: 1.2.27
运行程序报错:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".解决方案

完美解决问题:
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

上一篇:hangfire报错 Could not load file or assembly 'DynamicProxyGenAssembly2, Culture=neutral, PublicK


下一篇:Java运行报错:Error: Could not find or load main class