13

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

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

Note that the recommendation for the second configuration comes straight from the Spring Cloud Service Registration and Discovery documentation. It works quite well for INFO and other ‘normal’ levels. However, the log also shows (reformatted by me):

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

Now, false is a very interesting level, isn’t it? How can I disable a logger completely?

1 Answer 1

26

The yaml-parser interprets the words OFF and ON as Boolean and so passes false or true to the logging framework. If you want to disable logging with the level OFF you need to set the value of the property as a String which can be achieved by single quotes. Your example modified:

logging: level: org.hibernate.SQL: INFO com.netflix.eureka: 'OFF' 
Sign up to request clarification or add additional context in comments.

1 Comment

That’s it. It seems I simply didn’t wonder enough about that false in the error message.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.