Marged Marged - 1 month ago 19
YAML Question

Set root logging level in application.yml

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.

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:

Failed approach 1:

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


Failed approach 2:

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


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

Answer

You can use ROOT to configure the root logging level:

logging:
  level:
    ROOT: DEBUG