Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 245
Bartosz Bilicki Avatar asked Feb 01 '17 15:02

Bartosz Bilicki


1 Answers

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.

like image 165
Bartosz Bilicki Avatar answered Sep 29 '22 06:09

Bartosz Bilicki