Java基础学习总结(179)——Java 日志框架冲突解决方案大汇总

前言

你是否遇到过配置了日志,但打印不出来的情况?你是否遇到过配置了logback,启动时却提示log4j错误的情况?像下面这样:

log4j:WARN No appenders could be found for logger (org.example.App).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

你是否遇到过SLF4J的这种报错?

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/jiang/.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/jiang/.m2/repository/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]

你是否遇到过DUBBO日志打印不正常的情况?

上一篇:Spring Boot利用Logback输出日志到指定位置的简单配置及使用方式


下一篇:05-01-SpringBoot之日志框架整合