title: How do I configure Spring and SLF4J so that I can get logging?
body: <p>I've got a maven &amp; spring app that I want logging in. I'm keen to use SLF4J.</p>
  
  <p>I want to put all my config files into a directory {classpath}/config including log4j.xml and then init using a spring bean.</p>
  
  <p>e.g.</p>
  
  <pre><code>&lt;bean id="log4jInitialization" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"&gt;
      &lt;property name="targetClass" value="org.springframework.util.Log4jConfigurer"/&gt;
      &lt;property name="targetMethod" value="initLogging"/&gt;
      &lt;property name="arguments"&gt;
          &lt;list&gt;
              &lt;value&gt;classpath:config/log4j.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>However I get this warning and no logging.</p>
  
  <blockquote>
    <p>log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" rel="noreferrer">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info.</p>
  </blockquote>
  
  <p>I've googled around and can't find a simple example on setting this up. Any ideas?</p>