SpringBoot LoggerFactory is not a Logback LoggerContext but Logback is on the classpath
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的更多相关文章
- 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 ...
- 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 ...
- 安装springboot时遇到 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.问题
将工程外部jar包删除slf4j就可以运行.
- 解决LoggerFactory is not a Logback LoggerContext but Logback is on the classpath
因为引用了log4j2同时还引用了logback
- 【spring boot logback】日志logback格式解析
日志logback格式解析 logback官网 格式解析 https://logback.qos.ch/manual/layouts.html#ClassicPatternLayout 官网格式解析有 ...
- springboot结合日志门面SLF4j和日志实现Logback的使用
一.此处主要介绍在springboot工程下如何使用 logback + slf4j 进行日志记录. logback主要包含三个组成部分:Loggers(日志记录器).Appenders(输出目的在 ...
- 🔥SpringBoot图文教程2—日志的使用「logback」「log4j」
有天上飞的概念,就要有落地的实现 概念+代码实现是本文的特点,教程将涵盖完整的图文教程,代码案例 文章结尾配套自测面试题,学完技术自我测试更扎实 概念十遍不如代码一遍,朋友,希望你把文中所有的代码案例 ...
- springboot中用来进行查看错误日志的logback文件
<?xml version="1.0" encoding="UTF-8"?> <!-- 从高到地低 OFF . FATAL . ERROR . ...
- lombok+slf4j+logback SLF4J和Logback日志框架详解
maven 包依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lomb ...
随机推荐
- 【C# 开发技巧】番外篇故事-我是一个线程
我是一个线程 我是一个线程,一出生就被编了一个号——0x3704,然后被领到一间昏暗的屋子里,在这里,我发现了很多和我一模一样的同伴.我身边的同伴0x6900待的时间比较长,他带着沧桑的口气对我说:“ ...
- Centos7之pacemaker高可用安装配置详解
申明: centos7的pacemaker与6使用的方法不一致,即使用centos6.x的方法在centos7.x上面配置pacemaker不能成功. 因此openstack 上面的centos7.1 ...
- 查询 ip占用导致ip不通的 问题 查IP对应的mac地址
IP冲突, 同一个IP配到了多余1台的机器上 ,导致IP 不通的情况,此时需要查询 都有哪台机器配置了这个IP,用 arping 命令, 具体命令 类似于 ping ,直接 arping + 目标地 ...
- 到处抄来的SUCTF2019 web wp
0x01 EasySQL 这是一个考察堆叠注入的题目,但是这道题因为作者的过滤不够完全所以存在非预期解 非预期解 直接构造 *,1 这样构造,最后拼接的查询语句就变成了 select *,1||fla ...
- 【数据库开发】Redis数据库设置密码
redis配置密码1.通过配置文件进行配置yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到 ? 1 #requirepass foobared 去掉行前的注释 ...
- 【计算机视觉】Selective Search for Object Recognition论文阅读1
Selective Search for Object Recognition 作者: J. R. R. Uijlings, K. E. A. van de Sande, T. Gevers, A. ...
- 基于MSP430G2231实现多路数据采集器
基于MSP430G2231实现多路数据采集器 声明:引用请注明出处http://blog.csdn.net/lg1259156776/ 系列博客说明:此系列博客属于作者在大三大四阶段所储备的关于电子电 ...
- 学习笔记:oracle学习二:oracle11g数据库sql*plus命令之常用sqlplus命令、格式化查询结果
目录 1.常用sqlplus命令 1.1 HELP命令 1.2 describe命令 1.3 SPOOL命令 1.4 其他常用命令 1.4.1 define命令 1.4.2 show命令 1.4.3 ...
- 消息中间件——RocketMQ(一) 环境搭建(完整版)
每章一点正能量:每当你想要放弃的时候,就想想是为了什么才一路坚持到现在. 前言 最近在回顾复习Java基础中的一些知识点,发现了一些以前见过但是没有留意却特别有意思的知识特性,比如这次想分享的Java ...
- Markdown 空格详细介绍
它叫不换行空格,全称No-Break Space,它是最常见和我们使用最多的空格,大多数的人可能只接触了 ,它是按下space键产生的空格.在HTML中,如果你用空格键产生此空格,空格是不会累加的 ...