Reputation: 379
I am using Spring Boot and want to completely disable the automatic logging configuration and use SLF4J and logback directly instead.
I've tried the following:
@EnableAutoConfiguration(exclude={LoggingApplicationListener.class})
Which didn't work. Is there a way to completely disable the spring boot logging configuration?
Upvotes: 3
Views: 4717
Reputation: 4717
In case you don't want to configureJAVA_OPTS
, you can override behaviour of SpringBootServletInitializer
as described in Spring Boot: LoggingApplicationListener interfering with Application Server logging
Upvotes: 1
Reputation: 4432
Check out Dave Syer's answer. I think it is the best thing you can do to erase Spring Boot default logging config.
Spring Boot programmatic logging configuration
Upvotes: 1
Reputation: 3871
I believe that Spring uses a property that overrides the configuration set by default and the annotation you're using.
I once had the same problem and I solved it by specifying the following:
-Dlogging.config=log4j-live.xml -Dlog4j.debug
Let me know if that works for you.
Upvotes: 2