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


参考:

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即可。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM