問題描述
我在 Spring Boot (1.3 M1) 中使用了 application.properties,并開始將其轉換為 yaml 文件,因為它變得越來越復雜.
I used an application.properties with Spring Boot (1.3 M1) and started to translate it into a yaml file because it grew more and more complex.
但我在將其翻譯成 yaml 時遇到問題:
But I have problems translating this into yaml:
logging.level.*=WARN
logging.level.com.filenet.wcm=ERROR
logging.level.de.mycompany=DEBUG
最后兩行很容易翻譯成這樣:
The last two lines are easily translated into this:
logging:
level:
com.filenet.wcm: ERROR
de.mycompany: DEBUG
但是如何添加根日志級別的值?這兩種方法都失敗了:
But how to add the values for the root logging level ? These two approaches failed:
方法一失敗:
logging:
level: WARN
com.filenet.wcm: ERROR
de.mycompany: DEBUG
方法2失敗:
logging:
level:
star: WARN
com.filenet.wcm: ERROR
de.mycompany: DEBUG
我閱讀了 docs,搜索了 stackoverflow 和 google,但沒有找到有效語法的示例.
I read the docs, searched stackoverflow and googled but did not find an example for a valid syntax.
推薦答案
你可以使用ROOT
來配置root日志級別:
You can use ROOT
to configure the root logging level:
logging:
level:
ROOT: DEBUG
這篇關于在 application.yml 中設置根日志級別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!