简体   繁体   中英

logging.level.root does not work (spring Boot)

I have property logging.level.root=FATAL in my application.properties, but it does not work. Application stil uses levels defined in my logback-spring.xml

I have read whole http://docs.spring.io/spring-boot/docs/1.4.4.RELEASE/reference/htmlsingle/#howto-logging but I am unable to find a clue what could be wrong.

My logback-spring.xml starts with

<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

Then standard logger configuration, like

<logger name="org.hibernate" level="INFO"/>

Where is the code that uses logging.level.* property? I have checked org.springframework.boot.logging.LoggingSystem, org.springframework.boot.logging.logback.LogbackConfigurator, org.springframework.boot.logging.logback.LogbackLoggingSystem but I am unable to find any references to logging.level.* properties.

I have same issue with Spring Boot 1.4.3, 1.4.4, 1.5.1 but it does not work in any of them.

logging.level.root property works fine unless there is more specific logger configuration elsewhere. In my case, I had a lot of package/class-specific configuration in my xml configuration file.

I decided to remove all this package/class-specific entries from xml config file (that file resides inside jar file). Now I have complete flexibility configuring log levels from environment variables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM