title: How to make CXF Logging feature work with SOAP messages?
body: <p>I have logging set up for CXF. It is successfully logging using log4j. As a test I have modified the settings in <code>log4j.properties</code>, where the root logger is set to <code>INFO</code>.</p>
  
  <p>Adding <code>log4j.logger.org.apache.cxf=DEBUG, C</code> causes CXF logging to appear in the log file. However, SOAP messages are not getting logged as they hit the server. I have set up <code>cxf.xml</code> as <a href="http://cxf.apache.org/docs/configuration.html" rel="nofollow">the guide</a> dictates. The file looks like this:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation="http://cxf.apache.org/core 
    http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;
  
      &lt;cxf:bus&gt;
        &lt;cxf:features&gt;
          &lt;cxf:logging /&gt;
        &lt;/cxf:features&gt;
      &lt;/cxf:bus&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>This file, when packaged in the .war, is in <code>/WEB-INF/classes/cxf.xml</code>. Based on my reading, this is all that is necessary to have CXF start logging inbound and outbound messages.</p>
  
  <p>I have:</p>
  
  <ol>
  <li>Successfully replaced log4j as CXF's default logger.</li>
  <li>Added the logging feature to the cxf bus.</li>
  <li>Ensured that CXF components are able to log.</li>
  <li><p>Additionally specified the specific loggers as allowable:</p>
  
  <pre><code>log4j.logger.org.apache.cxf.interceptor.LoggingInInterceptor=DEBUG, C
  log4j.logger.org.apache.cxf.interceptor.LoggingOutInterceptor=DEBUG, C
  </code></pre></li>
  </ol>
  
  <p>The raw soap messages however, refuse to get logged. What am I doing wrong?</p>
  
  <p>edit: adding web.xml and applicationContext.xml as requested</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
        &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
    &lt;/context-param&gt;
  
    &lt;listener&gt;
        &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
    &lt;/listener&gt;
  
    &lt;servlet&gt;
        &lt;servlet-name&gt;cxf&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;cxf&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;session-config&gt;
        &lt;session-timeout&gt;60&lt;/session-timeout&gt;
    &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>applicationContext.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:soap="http://cxf.apache.org/bindings/soap"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jaxws="http://cxf.apache.org/jaxws"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/jee
       http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"
     default-dependency-check="none" default-lazy-init="false"&gt;
  
  &lt;!-- Load the needed resources that are present in the cxf* jars --&gt;
  &lt;import resource="classpath:META-INF/cxf/cxf.xml"/&gt;
  &lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/&gt;
  &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml"/&gt;
  
  &lt;!--Endpoint Info is below here --&gt;
  &lt;/beans&gt;
  </code></pre>