how turn off debug log messages in spring boot

In application.properties you can add ‘logging.level.*=LEVEL’ where ‘LEVEL’ is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. * is responsible for package/class.

For example

logging.level.root=WARN
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR

This means that root logger has WARN level. org.springframework.web is on DEBUG level, but all hibernates files are logged only ERROR.

In your case you must set logging.level.root on one of level from INFO, WARN, ERROR,FATAL or OFF to turn off all logging.

See https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html#boot-features-custom-log-levels


While using Spring Rest Docs with SpringMockMVC with testLogging.showStandardStreams set to true in Gradle, Spring cluttered the console with info & debug logs. I had to use Mkyong's solution where in a logback-test.xml in src/test/resources needs to be created on top of the chosen solution here. Use log-level OFF, ERROR, WARN, DEBUG

logback-test.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml" />
    <logger name="org.springframework" level="ERROR"/>
</configuration>