Spring Boot and Logback: disable logger

Using Spring Boot 1.4 along with Logback, I configure logging in application.yml :

 logging: level: org.hibernate.SQL: INFO com.netflix.eureka: OFF 

Note that the recommendation for the second configuration is provided directly from the Spring Registration and Discovery of Cloud Services document. It works great for INFO and other "normal levels". However, the log also shows (reformatted by me):

 … oscloud.logging.LoggingRebinder : Cannot set level: false for 'org.hibernate.engine.internal.StatisticalLoggingSessionEventListener' 

Now false is a very interesting level, right? How can I completely turn off the recorder?

+5
source share
1 answer

The parser interprets the words OFF and ON as Boolean and therefore passes false or true to the logging structure. If you want to disable logging with the OFF level, you need to set the property value as String , which can be reached with single quotes. Your example has changed:

 logging: level: org.hibernate.SQL: INFO com.netflix.eureka: 'OFF' 
+13
source

All Articles