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