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?
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With