解決springboot yml配置 logging.level 報錯問題
阿新 • • 發佈:2020-02-21
如下所示:
logging: config: classpath:spring-logback.xml pattern: console: "%d - %msg%n" level: info
直接寫 level: info 會報錯:
org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String,java.lang.String>
...
Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String,java.lang.String>]...
解決方法 :加個root
logging: config: classpath:spring-logback.xml pattern: console: "%d - %msg%n" level: root: info
執行成功
以上這篇解決springboot yml配置 logging.level 報錯問題就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支援我們。