Spring Boot中实现logback多环境日志配置

丶灬走出姿态 提交于 2020-03-20 12:36:57

参考:

https://www.cnblogs.com/EasonJim/p/7801549.html

https://docs.spring.io/spring-boot/docs/1.5.7.RELEASE/reference/htmlsingle/#boot-features-custom-log-configuration

在根据文档配置后,出现了以下错误

Logging system failed to initialize using configuration from 'classpath:logback-dev.xml'
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@1:27 - no applicable action for [springProfile], current ElementPath  is [[springProfile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:24 - no applicable action for [root], current ElementPath  is [[springProfile][root]]

 

查看官方文档中关于此错误的描述

将logback.xml改为logback-spring.xml即可。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!