目录
1、如果你用的是spring boot2.x 怎么升级方便
2. Caused by: java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor
3、Log4j2 error- ERROR StatusLogger Unrecognized format specifier
版本
LibraryCurrentUpgradedLo4j2 related jar*2.17.11、如果你用的是spring boot2.x 怎么升级方便
在pom.xml里加log4j2.version属性, 覆盖掉spring-boot-starter-parent的指定版本。
原因是:
spring-boot-dependendencies.pom里定义了 log4j2.version属性,利用它的值加的log4j2相关的包。
...、
在 log4j-bom.pom 里其实它把所有的log4j相关包都加了。所以在我们的项目你直接用就可以了。
如果你不是很了解
Maven – Introduction to the Dependency Mechanism
2. Caused by: java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor
异常信息:
Caused by: java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor.
原因:
项目使用了log4j2,由于使用了全局异步打印日志的方式,还需要引入disruptor的依赖
log4j2.xml
解决方法:
升级Disruptor 到3.4.0 版本
3、Log4j2 error- ERROR StatusLogger Unrecognized format specifier
错误信息:
ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
ERROR StatusLogger Reconfiguration failed: No configuration found for '135fbaa4' at 'null' in 'null'
相关代码- pom.xml
解决方法:
打包的时候去掉Log4j2Plugins.dat 文件。