Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot - Cannot turn off logging

I am trying to turn off the console output in STS for a spring boot application using the application.properties file.

Setting the value logging.level.root does seem to have some effect but I can never turn it off completely and nor can I turn off the auto configuration report output.

logging.level.root=OFF
spring.main.banner-mode=OFF
[email protected]@

The banner does get turned off by the property spring.main.banner-mode.

For some reason with the above properties I still get DEBUG output from spring on startup:

 2017-05-09 15:33:16.744 DEBUG 11772 --- [           main] .b.l.ClasspathLoggingApplicationListener : Application started with classpath:
 2017-05-09 15:33:16.798 DEBUG 11772 --- [           main] o.s.boot.SpringApplication               : Loading source class 

There are more lines telling me which properties files are being loaded but I dont want to fill up this post with them.

Following from this I then get the autoconfiguration report output.

I am wondering if I have a configuration issue and if this would cause spring to continue to output on start up?

like image 793
berimbolo Avatar asked May 09 '17 14:05

berimbolo


People also ask

How do I disable SLF4J?

To disable this behavior, you must add a logback configuration file called logback. xml in your java classpath root. You can download this minimal logback. xml file and add it in the src/main/resources directory for a maven project or beside fr directory for a simple java project.


1 Answers

To answer my own question: after trial and error, I finally ended up with the following which suppresses all output on startup via the application.properties file:

 logging.level.root=OFF
 logging.level.org.springframework.boot=OFF
 spring.main.banner-mode=OFF
like image 178
berimbolo Avatar answered Sep 28 '22 05:09

berimbolo