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 ...
随机推荐
- git 创建标签推送远程分支
目录 git 创建标签推送远程分支 查看tag 创建tag 推送标签到远程仓库 删除tag git 创建标签推送远程分支 标签概念: tag, 对于迭代频繁的项目. 每一个标签可以理解为一个版本. 创 ...
- Direct2D 学习笔记 前言
Direct2D模板程序网址:https://docs.microsoft.com/zh-cn/windows/win32/direct2d/direct2d-quickstart DirectX S ...
- dropout含义与原理
含义 在训练过程中,对神经网络单元按照一定比例暂时将其丢弃. 原理 由于网络参数过多,训练数据少,或者训练次数过多,会产生过拟合的现象.dropout产生的一个重大原因就是为了避免过拟合. 每一层的神 ...
- 【AtCoder】diverta 2019 Programming Contest 2
diverta 2019 Programming Contest 2 A - Ball Distribution 特判一下一个人的,否则是\(N - (K - 1) - 1\) #include &l ...
- Redis 常用命令学四:列表类型命令
1.在列表两端增加值的命令 127.0.0.1:6379> lpush 1 (error) ERR wrong number of arguments for 'lpush' command 1 ...
- php类常量
类常量类常量可以使用define定义,也可用const定义,但是在类的内部,只允许用const定义,类常量不能更新,也不能删除类常量通常是大写的,两个单词之间用下滑线连接,如MY_NATION类常量在 ...
- SAS学习笔记38 SAS Comments注释语句
通常来讲,注释语句有四种: 1.* message; 2.COMMENT message; 3./* message */ 4.%* message; 第一种的主要限制是注释之中不得有“:”符号.通常 ...
- Linux 系统下提取 ShellCode
未完待续 1.使用C语言编写一个获得系统Shell的小程序. #include <unistd.h> int main() { char * shell[2]; shell[0]=&quo ...
- vs2019 扩展工具
这里只是做个记录,没啥技术含量 本人代码上有些强迫症,所以我的本地代码一定不可以丢,之前用vs2013开始,就安装了localhistory这个插件,十分方便,觉得不用了,清了即可,也不占地方. 但是 ...
- JS OOP -01 面向对象的基础
JS面向对象的基础: 1.用定义函数的方式定义类 2.用new操作符获得一个类的实例 3.使用 [ ] 引用对象的属性和方法 4.动态添加,修改,删除对象的属性和方法 5.使用 { } 语法创建无类型 ...