首页 > 其他 > 详细

SLF4J: Class path contains multiple SLF4J bindings 问题解决

时间:2021-04-04 23:03:16      阅读:40      评论:0      收藏:0      [点我收藏+]

SpringBoot 启动后输出:

DEBUG StatusLogger org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/xxx/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/xxx/.m2/repository/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

 

系统能正常正常启动,这个提示是因为存在多个日志实现绑定,即:

(1) logback-classic-1.2.3.jar 

(2) slf4j-simple-1.7.25.jar

【SLF4j : Simple Logging Facade for Java (SLF4J),目前用的比较多的日志门面,类似commons-log库】

SpringBoot默认用的logback,那就把slf4j-simple给禁用掉。可以通过idea的查找依赖关系或mvn dependency:tree 来找到依赖

最后发现是j2cache依赖了slf4j-simple

        <dependency>
            <groupId>net.oschina.j2cache</groupId>
            <artifactId>j2cache-core</artifactId>
            <version>2.7.2-release</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

增加排除,问题解决。

 

 

SLF4J: Class path contains multiple SLF4J bindings 问题解决

原文:https://www.cnblogs.com/webjlwang/p/14616650.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!