I know its a old thread, but may be useful for people looking for answers.
For AXIS-1 Server side logging, update your server-config.wsdd
like below. server-config.wsdd
is under WEB-INF
folder of your war file.
A new handler for log. The file name along with path is configurable.
<handler name="log" type="java:org.apache.axis.handlers.LogHandler">
<parameter name="LogHandler.fileName" value="/tmp/req-res-axis.log" />
</handler>
You can also use the LogHandler.writeToConsole
parameter with the value as "true"
to log in your console log.
Then update the <globalConfiguration>
section to have
<requestFlow>
<handler type="log"/>
</requestFlow>
<responseFlow>
<handler type="log"/>
</responseFlow>
If the requestFlow
and responseFlow
contains other handlers ,put the log as the first handler.
This should be only used for debugging purpose not for production. Since the logging is naive and do the normal write operation on the file without any buffer. Secondly, the log file will grow to GB's since there is no rollover mechanism.
For AXIS-1 Client Side logging, update your client-config.wsdd
like below. The client-config.wsdd
should go into your classpath
directly under a root folder configured in the classpath
not in any sub-folders. The best location is the same directory where your log4j.xml
or log4j.properties
file is present(Thanks to #MukeshKoshyM post above).
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler name="log" type="java:org.apache.axis.handlers.LogHandler" >
<parameter name="LogHandler.fileName" value="/tmp/axis_req_res.log"/>
</handler>
<globalConfiguration>
<requestFlow>
<handler type="log" />
</requestFlow>
<responseFlow>
<handler type="log" />
</responseFlow>
</globalConfiguration>
<transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender" />
</deployment>
The same issue mentioned for server side logging is applicable for client side as well.
For production, write your own log handler by extending org.apache.axis.handlers.BasicHandler
and configure the class file in the handler. Please look the above answer from #raspayu to configure your own. To log the faults override the public void onFault(MessageContext msgContext)
method in your Handler.