How to disable Spring Boot Registration Configuration?

I am using Spring Boot and want to completely disable automatic configuration registration and use SLF4J and logback directly.

I've tried the following:

@EnableAutoConfiguration(exclude={LoggingApplicationListener.class})

      

Which didn't work. Is there a way to completely disable Spring Boot logging configuration?

+3


source to share


3 answers


I believe Spring uses a property that overrides the default config and annotation you are using.

I had the same problem and solved it by specifying the following:



-Dlogging.config=log4j-live.xml -Dlog4j.debug

      

Let me know if this works for you.

+2


source


Notice Dave Siera's answer. I think this is the best you can do to erase Spring's default boot logging configuration.



Spring Program Logs Boot Configuration

+1


source


If you don't want to customize JAVA_OPTS

, you can override the behavior SpringBootServletInitializer

as described in Spring Boot: LoggingApplicationListener preventing logging from application log

0


source







All Articles