Thursday, April 2, 2015

Logging Axis XML

In case you have a Web service running using Apache Axis and you want to know the XML that is being transported there is an easy way to set up the loggin in log4j.

You just can add to your log4j config file:

<appender name="AXIS" class="org.apache.log4j.FileAppender">
   <param name="File" value="/etc/log/axis.log" />
   <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
   </layout>
</appender>


 <category name="org.apache.axis.transport.http.HTTPSender">
<priority value="DEBUG" />
<appender-ref ref="AXIS" />
</category>


Like that in log file axis,log you will be able to see the XML that is being transported.

No comments:

Post a Comment