2

I have generated some proxy classes that are consumed by a Java Service. (using WSDL2JAVA)

I need to find a way to log requests and responses whenever the proxy class invokes the respective external web service.

Is there any easy way to achieve this?

Thanks! Silvio.

Silvestre
  • 804
  • 11
  • 25

2 Answers2

2

If you are using Axis, configure log4j like this:

log4j.rootLogger=ERROR
log4j.appender.axisLogFile=org.apache.log4j.RollingFileAppender
log4j.appender.axisLogFile.File=soap-messages.log
log4j.appender.axisLogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.axisLogFile.layout.ConversionPattern=[%d{DATE} - %-5p] %m%n
log4j.logger.org.apache.axis.transport.http.HTTPSender=DEBUG, axisLogFile
rodrigoap
  • 7,405
  • 35
  • 46
1

This is awesome, you need add the following for in java code.

PropertyConfigurator.configure(<log4j property file>);
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197