引入log4j2后启动报错。

Exception in thread "main" java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@7:17 - no applicable action for [Properties], current ElementPath  is [[Configuration][Properties]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:35 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:36 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@13:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@16:57 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@21:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:58 - no applicable action for [Logger], current ElementPath  is [[Configuration][Loggers][Logger]]

经查找原因:是由于引入的log4j2和spring-boot-starter-web默认的日志配置冲突。

解决方法:
将spring-boot-starter-web默认的日志排除掉:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions></dependency>

springboot配置log4j2报错:java.lang.IllegalStateException: Logback configuration error detected:相关推荐

  1. springboot集成logback,报错java.lang.IllegalStateException: Logback configuration error detected:

    最近需要将一个springboot项目部署到一台新服务器上.而且新服务器是完全copy了旧服务器的环境与项目.但是在新服务器上启动该springboot项目,就一直报错 2019-03-18 18:5 ...

  2. Spring Boot与Log4j2集成之java.lang.IllegalStateException: Logback configuration error detected:

    引言: 一个问题的分析与解决过程是表与里的过程,是一个大胆猜测与小心求证的过程,spring boot与log4j2的集成过程中,我将描述一下分析这个问题的思路和过程. 我一直强调一点: 重要的不是解 ...

  3. logback启动报错,IllegalStateException: Logback configuration error detected...

    报错信息: Caused by: java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch. ...

  4. Spring Boot单元测试报错java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]

    一:运行test类方法时候报错 报错 java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. S ...

  5. SpringBoot+MyBatis启动报错java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

    2019独角兽企业重金招聘Python工程师标准>>> 如题,在启动SpringBoot时报SpringBoot+MyBatis启动报错java.lang.NoClassDefFou ...

  6. 报错 java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @Bootstra

    由于我maven仓库之前已经有了有个5.0.10的test包 导致我的变量 <org.springframework.version>4.2.5.RELEASE</org.sprin ...

  7. 解决Hbase报错java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for....

    完整报错为: java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper ...

  8. 解决:room无论如何怎么修改数据库版本都报错java.lang.IllegalStateException: Room cannot verify the data integrity

    问题描述 这已经是第二次遇到这个bug了,第一次卡了一两天,这次卡了半天. bug: java.lang.IllegalStateException: Room cannot verify the d ...

  9. Android Studio报错 “java.lang.IllegalStateException: Room cannot verify the data integrity” 解决方法

    最近在Android Studio遇到以下报错: Caused by: java.lang.IllegalStateException: Room cannot verify the data int ...

最新文章

  1. 我的工作日报 - 2020-9-16 星期三
  2. Junit3.8源码--核心类
  3. 收藏 | 深度学习框架简史:TensorFlow和PyTorch双头垄断
  4. C语言libcurl:Uses the CURLINFO_TLS_SESSION data.
  5. .htaccess更改目录下的默认主页
  6. gitlab两种连接方式:ssh和http配置介绍
  7. mysql 单例模式_php基于单例模式封装mysql类完整实例
  8. Hvv近期0day总结二
  9. ArcGis for JavaScript 4.23版本接入国家天地矢量地图
  10. 无限维乘积空间(彼此独立)的测度(完)
  11. 厦门大学c语言2017,厦门大学2017年各专业录取分数线
  12. 百度地图 实现 热力图
  13. 小白安装cadence virtuoso
  14. 位数不足前面补0mysql语句_SQL语句 不足位数补0
  15. Javaweb1:HTML、各种标签
  16. VR全景拍摄如何正确的拍摄?全景摄影大赛等你来
  17. 机架式服务器物理尺寸,1U机架式服务器机箱尺寸长宽高
  18. 鼠标控制两台台式机_台式机和控制台上的真棒实时GI
  19. hjr-MUD游戏(二):HTML5-APP客户端编写
  20. 2006-2020年10月各类型国债利率

热门文章

  1. CISSP考点拾遗——分割隧道与全隧道
  2. 阿里腾讯“主战场”揭幕:马云33亿入股恒生电子
  3. 江苏银行业务对接,现金管理平台,银企直联
  4. js以yyyy-MM-dd HH:mm格式获取当前系统日期
  5. 极客大学产品经理训练营 认识产品经理下 第2课总结
  6. altium designer常用元件电气符号和封装形式
  7. 设置a标签链接字体的颜色
  8. Android统一管理Timer计时器Service工具
  9. RMAN使用备份按时间点传输表空间
  10. 色选机和筛选机的区别?