SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
原创 loonbs 发表于:2022-08-05 22:06:53
  阅读 :93   收藏   编辑

启动错误日志

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.jar, slf4j-log4j12.jar, slf4j-jdk14.jar 或 logback-classic.jar其中的一个可以 了

  • 如果是spring boot项目引入
       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
            <version>1.5.8.RELEASE</version>
        </dependency>
  • 或可以单独引入
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.25</version>
    <scope>compile</scope>
  </dependency>