Ummul
Ummul

Reputation: 35

mule cxf logging

I have a SOAP client flow in mule and I have added cxf interceptor to see the request response. Is there any way to view the exact HTTP request response in mule configuration?

Here is my code for the flow:

<http:outbound-endpoint address="http://84.19.253.166/service.asmx" method="POST" >
        <cxf:jaxws-client
        enableMuleSoapHeaders="false" 
        clientClass="org.tempuri.Service" 
        port= "ServiceSoap" 
        wsdlLocation="classpath:service.wsdl" 
        operation="ProcessRequest" 
        >
        <cxf:inInterceptors>
        <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
        </cxf:inInterceptors>
<cxf:outInterceptors>
    <spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</cxf:outInterceptors>    
     </cxf:jaxws-client>
     </http:outbound-endpoint>

Upvotes: 1

Views: 2056

Answers (2)

deyvw
deyvw

Reputation: 820

I strongly recommend to add one simple line to log4j2.xml

  <AsyncLogger name="org.apache.cxf" level="INFO"/>

You choose between couple of options in level range (INFO, WARN, DEBUG, etc.)

If you want to save you log to other file, just simple type:

<AppenderRef ref="cxf_logs" />

But remember to add File-Appender

<Appenders>
<RollingFile name="cxf_logs" fileName="${sys:mule.home}${sys:file.separator}logs${sys:file.separator}your-interfaces-cxf.log" 
             filePattern="${sys:mule.home}${sys:file.separator}logs${sys:file.separator}your-interfaces-cxf-%i.log">
        <PatternLayout pattern="%d [%t] %-5p %c - %m%n" />
        <SizeBasedTriggeringPolicy size="10 MB" />
        <DefaultRolloverStrategy max="10"/>
    </RollingFile>
   </Appenders>

Upvotes: 0

David Dossot
David Dossot

Reputation: 33413

The current HTTP connector of Mule 3 uses Commons HttpClient 3.x for outbound dispatches.

So enable full wire logging for Commons HttpClient and you'll see the complete HTTP frames sent and received with the remote server.

Upvotes: 2

Related Questions