zoukankan      html  css  js  c++  java
  • springboot日志

    1、
    java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext

    去掉spring-boot-starter-actuator里的 log4j-to-slf4j 即可。

    <exclusions>
                    <exclusion>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-to-slf4j</artifactId>
                    </exclusion>
                </exclusions>
    

    2、

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/Users/guanliyuan/mrepo_data_dev/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:/Users/guanliyuan/mrepo_data_dev/org/apache/logging/log4j/log4j-slf4j-impl/2.11.2/log4j-slf4j-impl-2.11.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/Users/guanliyuan/mrepo_data_dev/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.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、springboot使用的日志依赖

    2、其他组件使用的日志依赖

    这几个个包的一个实现类包名一样


    解决:
    mvn dependency:tree
    去掉log4j-slf4j-impl与slf4j-log4j12

    <exclusion>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-slf4j-impl</artifactId>
                    </exclusion>
    
    
    <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
    
    
  • 相关阅读:
    mouse_event,keybd_event
    构造自己的StringGrid
    BMP2JPG,JPG2BMP
    $J的用法
    一个简单的系统托盘程序
    构造自己的双向链表
    C++的iostream标准库介绍
    D3DXVec4Dot 函数
    3D游戏从头编之D3D(3)
    D3DXVec4Cross 函数
  • 原文地址:https://www.cnblogs.com/cashew/p/14393567.html
Copyright © 2011-2022 走看看