title: How to enable Log4j on SpringBoot Gradle: log4j-over-slf4j.jar, slf4j-log4j12.jar Multiple Bindings
body: <p>Trying to enable <code>log4j</code> in SpringBoot + Gradle project is less common than Maven. So, here's the problem I'm facing:</p>
  
  <pre><code>gradle clean bootRun --stacktrace
  :clean
  :compileJava
  :processResources
  :classes
  :findMainClass
  :bootRun
  SLF4J: Class path contains multiple SLF4J bindings.
  SLF4J: Found binding in [jar:file:/home/mdesales/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: Found binding in [jar:file:/home/mdesales/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. 
  SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
  Exception in thread "main" java.lang.ExceptionInInitializerError
  </code></pre>
  
  <h1>Questions</h1>
  
  <ul>
  <li>How to solve it using Gradle? </li>
  <li>How to use Log4j 1.x instead of Log4j2 as documented at <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html#howto-configure-log4j-for-logging" rel="nofollow">http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html#howto-configure-log4j-for-logging</a>?</li>
  <li>How to reuse an existing log4j.xml as is, without changes, in SpringBoot?</li>
  </ul>