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?
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.
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
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