其他分享
首页 > 其他分享> > springboot 整合logback

springboot 整合logback

作者:互联网

真是处处都是坑,一步一个坑。

因为log4j2的漏洞暴露的原因,整改项目中的所有使用log4j2的日志打印,更换为logback

结果代码更换完后,项目直接启动不起了

直接上报错:

09:39:22,934 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@11:100 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]
09:39:22,940 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@18:143 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]
09:39:22,941 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:114 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]
09:39:22,941 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:113 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]
09:39:22,941 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:124 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]

原因是我用的配置文件名称为logback.xml,导致项目启动时先加载logback后加载application.properties 导致放在application.properties读取不到所以报错。

结果将logback.xml改为logback-spring.xml就可以了

参考:https://blog.csdn.net/qq_17394183/article/details/89920053

标签:ch,qos,springboot,springProperty,current,spi,整合,logback
来源: https://www.cnblogs.com/wmy10/p/15702168.html