SpringBoot 在启动项目的时候一起错误:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.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 [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory

其实这是slf4j 日志包冲出导致 ,怎么查看包冲突呢?

zookeeper包和junit包中都引入了日志包:

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
安装maven help 插件,在pom.xml文件下点击dependency Analyzer分析查看冲突的包

找到冲突后通过exclude排除掉就好了;

SpringBoot LoggerFactory is not a Logback LoggerContext but Logback is on the classpath的更多相关文章

  1. springboot项目maven报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback

    完整信息如下 SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/D:/deve ...

  2. LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation

    2019-06-26 22:19:57.408642475 java.lang.IllegalArgumentException: LoggerFactory is not a Logback Log ...

  3. 安装springboot时遇到 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.问题

    将工程外部jar包删除slf4j就可以运行.

  4. 解决LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

    因为引用了log4j2同时还引用了logback

  5. 【spring boot logback】日志logback格式解析

    日志logback格式解析 logback官网 格式解析 https://logback.qos.ch/manual/layouts.html#ClassicPatternLayout 官网格式解析有 ...

  6. springboot结合日志门面SLF4j和日志实现Logback的使用

    一.此处主要介绍在springboot工程下如何使用 logback + slf4j  进行日志记录. logback主要包含三个组成部分:Loggers(日志记录器).Appenders(输出目的在 ...

  7. 🔥SpringBoot图文教程2—日志的使用「logback」「log4j」

    有天上飞的概念,就要有落地的实现 概念+代码实现是本文的特点,教程将涵盖完整的图文教程,代码案例 文章结尾配套自测面试题,学完技术自我测试更扎实 概念十遍不如代码一遍,朋友,希望你把文中所有的代码案例 ...

  8. springboot中用来进行查看错误日志的logback文件

    <?xml version="1.0" encoding="UTF-8"?> <!-- 从高到地低 OFF . FATAL . ERROR . ...

  9. lombok+slf4j+logback SLF4J和Logback日志框架详解

    maven 包依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lomb ...

随机推荐

  1. Zabbix部分监控指标

    MySQL请求流量带宽.MySQL响应流量带宽.CPU使用率.内存利用率.网卡流量等.

  2. python爬取网页数据方法

    """#最基本,请求地址无参数# response=urllib.request.urlopen("https://www.scetc.edu.cn" ...

  3. python 全栈开发之旅

    目录 python 基础语法 python 数据类型(未完成) python 内置函数(未完成) python 常用标准库(未完成) python 类(未完成) python 进程.线程.协程(未完成 ...

  4. java、ruby、python、php等如何生成excel文档?

    excel在我们日常工作生活中会经常用到,通常我们都是用office软件去编写文档.但是对于格式一致的excel文档,如果还是使用人工完成,那绝不是我们软件工程师的姿态了~ 下面我就介绍一种方法,不需 ...

  5. 控件setText与setValue赋值顺序先后区别

    1.text与value设置不同的值一定要先赋值 value后赋值text, 否则全为value值 2.若只setValue,则getValue 与 getText获取的值全为value值 $('#t ...

  6. 总结几个最近处理问题中使用http协议的代码

    demo1:几个不同的http请求方式总结: ----------------------------------------------------------------------------- ...

  7. python 修改文件内容3种方法

    原文链接:https://www.cnblogs.com/wc-chan/p/8085452.html def alter(file,old_str,new_str): ""&qu ...

  8. 关于c++模板非类型参数中指针和引用类型必须为全局或者静态变量的问题

    之前在学习c++模板的时候,一直没留意到在非类型参数中对指针和引用有着一些限制,今早在复学模板的时候才注意到书上标明,指针和引用作为模板的非类型参数传递时必须要求是全局或者静态变量.其实不难想到,模板 ...

  9. Spring Cloud 中注册中心Eureka客户端配置

    注册中心配置客户端(注册一个虚拟的商品服务) 一.新建项目:     1.创建一个SpirngBoot应用,增加服务注册和发现依赖     2.模拟商品信息,存储在内存中     3.开发商品列表接口 ...

  10. 利用Python进行数据分析_Pandas_数据结构

    申明:本系列文章是自己在学习<利用Python进行数据分析>这本书的过程中,为了方便后期自己巩固知识而整理. 首先,需要导入pandas库的Series和DataFrame In [21] ...