在application.yml中设置根日志记录级别 [英] Set root logging level in application.yml

查看:1377
本文介绍了在application.yml中设置根日志记录级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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:

失败的方法1:

logging:
    level: WARN
        com.filenet.wcm: ERROR
        de.mycompany: DEBUG    

方法2失败:

logging:
    level: 
        star: WARN
        com.filenet.wcm: ERROR
        de.mycompany: DEBUG    

我阅读了文档,搜索stackoverflow并用谷歌搜索,但未找到有效语法的示例.

I read the docs, searched stackoverflow and googled but did not find an example for a valid syntax.

推荐答案

您可以使用ROOT配置根日志记录级别:

You can use ROOT to configure the root logging level:

logging:
  level:
    ROOT: DEBUG

这篇关于在application.yml中设置根日志记录级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆