no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]

logback错误日志

no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]

原因

logback.xml的加载早于application.yml配置文件,在logback.xml中使用<springProperty>标签来获取配置文件中的变量值,读取不到而报出错误信息。

解决方法:
1.将logback.xml重命名为logback-spring.xml。

2.将logback.xml重命名为自己指定的名字(xxx.xml),然后在配置文件中指定生效的文件。

logging:
  config: classpath:xxx.xml 

版权声明:本文为zcyt085原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。