title: Excluding ch.qos.logback overflows
body: <p>I'm using:</p>
  
  <pre><code>compile (libs.spring_boot_starter_logging)
  testCompile 'org.apache.qpid:qpid-broker:0.28'
  </code></pre>
  
  <p>Both of them have a SLF4J binding, so I have error:</p>
  
  <pre><code>SLF4J: Class path contains multiple SLF4J bindings.
  SLF4J: Found binding in [jar:file:/C:/Users/maciej.glowala.ext/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.11/ccedfbacef4a6515d2983e3f89ed753d5d4fb665/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: Found binding in [jar:file:/C:/Users/maciej.glowala.ext/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.6.4/6b4973e0320e220ec6534478d60233fd1cc51c9b/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
  </code></pre>
  
  <p>I can exclude version 1.6.4 from qpid-broker but it make error because broker cannot find some method which is included in newer version. When I want to exclude version 1.1.11 </p>
  
  <pre><code>compile (libs.spring_boot_starter_logging){
              exclude group: 'ch.qos.logback', module: 'logback-classic'
          }
  </code></pre>
  
  <p>I've got an overflow error</p>
  
  <pre><code>java.lang.StackOverflowError
      at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39)
      at org.apache.log4j.LogManager.getLogger(LogManager.java:45)
      at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
      at org.apache.log4j.Category.&lt;init&gt;(Category.java:57)
      at org.apache.log4j.Logger.&lt;init&gt;(Logger.java:37)
      at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:43)
      at org.apache.log4j.LogManager.getLogger(LogManager.java:45)
      at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
      at org.apache.log4j.Category.&lt;init&gt;(Category.java:57)
      at org.apache.log4j.Logger.&lt;init&gt;(Logger.java:37)
      .
      .
      .
  </code></pre>
  
  <p>What is more, I shouldn't exclude from <code>compile</code> when <code>SLF4J</code> binding is included in <code>testCompile</code> so I wanted to exclude for tests only using </p>
  
  <pre><code>configurations {
      testCompile.exclude group:'ch.qos.logback'
  }
  </code></pre>
  
  <p>But anyway I have still the same overflow error. Anyone can help me how to set build.gradle to use newer version for tests?</p>