title: How to disable auto-configuration of logging in Spring Boot?
body: <p>Spring Boot has a feature where it automatically detects any logging framework available (based on the presence of classes listed in <code>org.springframework.boot.logging.LoggingSystem.SYSTEMS</code> - 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.</p>
  
  <p>This is causing problems when deploying a Grails 3 app as a war file to JBoss EAP 6 (a.k.a. WildFly 7). <strong>When the application initializes, Spring Boot finds the JBoss-provided logging implementation of JUL</strong> (<code>org.jboss.logmanager.LogManager</code>)<strong>, and calls the <code>readConfiguration()</code> method on it, which messes up the logging configuration.</strong></p>
  
  <ul>
  <li><em>I would like to continue using the JBoss-provided logging implementation</em> 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.</li>
  </ul>
  
  <p><strong>Is there any way to disable Spring Boot's auto-configuration of logging?</strong> (I'm okay with Spring Boot <em>detecting and using</em> the logging framework; I just don't want it to try to <em>configure</em> it.) I have looked at the source code, but don't see any hooks to control this.</p>
  
  <p>Relevant source code:</p>
  
  <ul>
  <li><a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java" rel="nofollow noreferrer">LoggingApplicationListener</a></li>
  <li><a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java" rel="nofollow noreferrer">LoggingSystem</a></li>
  <li><a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java" rel="nofollow noreferrer">JavaLoggingSystem</a></li>
  </ul>
  
  <p>Possible ideas:</p>
  
  <ul>
  <li>Somehow remove <code>LoggingApplicationListener</code> from the list of application listeners before it receives the <code>ApplicationStartedEvent</code> or <code>ApplicationEnvironmentPreparedEvent</code> events (which triggers the configuration of logging)?</li>
  </ul>
  
  <p>These other related questions <em>don't</em> solve my problem, since the use case is different:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/25039249/disable-automatic-logging-configuration-in-spring-boot">Disable automatic logging configuration in spring boot</a></li>
  <li><a href="https://stackoverflow.com/questions/27153248/spring-boot-and-jboss-8-wildfly-log-configuration-application">Spring boot and JBoss 8 Wildfly log configuration application</a></li>
  <li><a href="https://stackoverflow.com/questions/23512456/spring-boot-application-configuration">Spring-boot application configuration</a></li>
  <li><a href="https://stackoverflow.com/questions/25491064/spring-boot-logging-configuration-when-deployed-as-war">Spring-Boot Logging configuration when deployed as .war</a></li>
  </ul>
  
  <p>Versions:</p>
  
  <ul>
  <li>Spring Boot - 1.3.3.RELEASE</li>
  <li>Grails - 3.1.5</li>
  </ul>