title: Java, Spring Tests, how do I configure logging normally defined in web.xml?
body: <p>I have the following defined for my test:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @WebAppConfiguration("/App/webapp")
  @ContextConfiguration({
          "classpath:/config/AConfig.xml",
          "classpath:/config/BConfig.xml",
          "classpath:/config/CConfig.xml",
          "classpath:/config/DConfig.xml"
  })
  public class MyTests{
      ...
  } 
  </code></pre>
  
  <p>In web.xml I use the same configuration plus additional configuration, for instance to configure filters and listeners. How can I enable these when doing tests? </p>
  
  <p>It would be great if Spring just used the same <strong>web.xml</strong> but I guess that might not be an option. </p>
  
  <p>I have this defined in web.xml:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath:/config/log4j.properties&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>Is there a way to configure logging from a a contextConfig.xml ( bean definition ) instead?</p>