今天搭建springboot的环境,在pom文件引入依赖

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.2.RELEASE</version>
    </parent>

搭建完毕之后出现如下结果:

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j/codes.html#StaticLoggerBinder for further details.

查看http://www.slf4j/codes.html#StaticLoggerBinde

解决方法应该就是引入slf4j-nop.jar就好了:
在pom.xml引入:

    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-nop</artifactId>
    <version>1.7.24</version>
    </dependency>

运行后发现没有提示Failed to load class “org.slf4j.impl.StaticLoggerBinder”


还有一种方法(不推荐)就是换成旧版本的springboot

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.3.RELEASE</version>
    </parent>

更多推荐

Spring Boot启动出现Failed to load class "org.slf4j.impl.StaticLoggerBinder"