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. 用 Unity 实现调色板功能

    用unity 实现调色板功能. 直接上代码: using UnityEngine; using System.Collections; using UnityEngine.UI; public cla ...

  2. API网关从入门到放弃

    前言 假设你正在开发一个电商网站,那么这里会涉及到很多后端的微服务,比如会员.商品.推荐服务等等. 那么这里就会遇到一个问题,APP/Browser怎么去访问这些后端的服务? 如果业务比较简单的话,可 ...

  3. python选课系统demo的小练习

    #简化选课系统代码:先登陆,然后判断身份并实例化,根据身份对应的类,让用户选择 class Manager: operate_dict=[ ('创造学生账号',"creat_student& ...

  4. javascript jssdk退出微信的方法

    javascript jssdk退出微信的方法 <pre> $('.tctip').on('click',function () { setTimeout("WeixinJSBr ...

  5. yml 文件中使用环境变量

    Spring Boot 中可以用 spring.profiles.active 参数来指定系统环境,让系统加载不同的配置文件. 可以在程序启动的时候加上参数来指定需要的配置 java -Dspring ...

  6. python 文件读写操作(24)

    以前的代码都是直接将数据输出到控制台,实际上我们也可以通过读/写文件的方式读取/输出到磁盘文件中,文件读写简称I/O操作.文件I/O操作一共分为四部分:打开(open)/读取(read)/写入(wri ...

  7. 『Python基础』第4节:基础数据类型初识

    本节只是对基础数据类型做个简单介绍, 详情会在之后慢慢介绍 什么是数据类型? 我们人类可以分清数字与字符串的区别, 可是计算机不能. 虽然计算机很强大, 但在某种程度上又很傻, 除非你明确告诉它数字与 ...

  8. react封装通用tab组件

    import React, { Component } from 'react' import PropTypes from 'prop-types' import _ from 'lodash' i ...

  9. Nginx学习笔记(四):基本数据结构

    目录 Nginx的一些特点 Nginx自定义整数类型 异常机制错误处理 内存池 字符串 时间与日期 运行日志   Nginx的一些特点 高性能 采用事件驱动模型,可以无阻塞的处理海量并发连接 高稳定性 ...

  10. ubuntu maven jdk

    https://blog.csdn.net/zrgood123/article/details/82894447 这里是将环境变量配置在etc/profile,即为所有用户配置JDK环境. 使用命令打 ...