Spring Boot has a feature where it automatically detects any logging framework available (based on the presence of classes listed in org.springframework.boot.logging.LoggingSystem.SYSTEMS
- either Logback, Log4j or JUL) and configures it from either an application-provided logging config file or Spring Boot's own default config file, packaged withing Spring Boot itself.
This is causing problems when deploying a Grails 3 app as a war file to JBoss EAP 6 (a.k.a. WildFly 7). When the application initializes, Spring Boot finds the JBoss-provided logging implementation of JUL (org.jboss.logmanager.LogManager
), and calls the readConfiguration()
method on it, which messes up the logging configuration.
- I would like to continue using the JBoss-provided logging implementation and JBoss-provided logging configuration, rather than packaging a separate logging implementation inside my war file. This allows me to configure all my applications on the app server from within the server's configuration file.
Is there any way to disable Spring Boot's auto-configuration of logging? (I'm okay with Spring Boot detecting and using the logging framework; I just don't want it to try to configure it.) I have looked at the source code, but don't see any hooks to control this.
Relevant source code:
Possible ideas:
- Somehow remove
LoggingApplicationListener
from the list of application listeners before it receives theApplicationStartedEvent
orApplicationEnvironmentPreparedEvent
events (which triggers the configuration of logging)?
These other related questions don't solve my problem, since the use case is different:
- Disable automatic logging configuration in spring boot
- Spring boot and JBoss 8 Wildfly log configuration application
- Spring-boot application configuration
- Spring-Boot Logging configuration when deployed as .war
Versions:
- Spring Boot - 1.3.3.RELEASE
- Grails - 3.1.5