美文网首页
SLF4J: Failed to load class &quo

SLF4J: Failed to load class &quo

作者: CallMe兵哥 | 来源:发表于2018-12-17 23:50 被阅读3次

    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
    在编程中引用slf4j时,有时候回出现“SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder” 问题,问题的原因在SLF4J的官网上能找到,slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar这几个jar包有且只有一个在的classpath路径下。

    完整的maven配置为:

      <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.12</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.25</version>
        </dependency>
    

    【官方链接】(https://www.slf4j.org/codes.html#StaticLoggerBinder

    相关文章

      网友评论

          本文标题:SLF4J: Failed to load class &quo

          本文链接:https://www.haomeiwen.com/subject/jcghkqtx.html