cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1529
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: GEOFFREY THOMPSON on 25-10-2011 03:36:47 PM
Developers,
 
I am using Apache Axis to communicate with a Web service, but the service is encrypted (over HTTPS) so I cannot use Wireshark to see exactly what's on the wire.
 
In my standalone test class, a log4j.properties file like so:
 
log4j.rootLogger=DEBUG, testApp
 
log4j.logger.org.apache.axis=DEBUG
log4j.logger.org.apache.axis.encoding=INFO
log4j.logger.org.apache.axis.utils=INFO
log4j.logger.org.apache.axis.message=INFO
log4j.logger.org.apache.axis.i18n=INFO
 
log4j.appender.testApp=org.apache.log4j.RollingFileAppender 
log4j.appender.testApp.File=C:\temp\mytomcatdebug.log
log4j.appender.testApp.layout=org.apache.log4j.PatternLayout
log4j.appender.testApp.layout.ConversionPattern=%t %-5p %c{2} - %m%n
 
This enables me to see the complete SOAP envelope on the way out and on the way back.
 
I need to see what these messages are when the class is a custom Action Element running in the VXML server.
 
I can configure log4j.properties in Tomcat\CVP\webapps\WEB-INF\classes and make it write to a file of my choosing (instead of Tomcat\bin\log where it normally writes) - so I can change the appender - but I cannot change the logger and make it write out from other classes.
 
I've tried a few things - made sure no other log4j.properties file exists, and I have checked that axis.jar does not include a log4j.properties file.
 
Has anyone tried to do something like this?
 
Regards,
Geoff

Subject: RE: Configuring log4j through to your custom classes. Can you do this?
Replied by: GEOFFREY THOMPSON on 26-10-2011 06:08:14 PM
I did find a way to log my SOAP messages. The log4j problem is unresolved, but this works. 
<!--
    Save this file as "client-config.wsdd" in the working directory
    of your Axis client. Axis will load it automatically. The
    configuration here tells Axis to save all incoming and outgoing
    XML into a file named "soapmessages.log"
-->
<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="c:/temp/soapmessages.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>

 
Place in Tomcat\CVP\webapps\WEB-INF\classes.
 
Credit to 

http://arendatwork.blogspot.com/2009/07/logging-soap-messages-axis-client.html
 
Regards,
Geoff

Subject: RE: Configuring log4j through to your custom classes. Can you do this?
Replied by: Joe Zamora on 22-12-2011 06:06:49 PM
Try this:

log4j.rootLogger=DEBUG, testApp

log4j.logger.your.package.here=DEBUG
log4j.logger.org.apache.axis=DEBUG
log4j.logger.org.apache.axis.encoding=INFO
log4j.logger.org.apache.axis.utils=INFO
log4j.logger.org.apache.axis.message=INFO
log4j.logger.org.apache.axis.i18n=INFO

log4j.appender.testApp=org.apache.log4j.RollingFileAppender 
log4j.appender.testApp.File=C:\temp\mytomcatdebug.log
log4j.appender.testApp.layout=org.apache.log4j.PatternLayout
log4j.appender.testApp.layout.ConversionPattern=%t %-5p %c{2} - %m%n

Subject: RE: Configuring log4j through to your custom classes. Can you do this?
Replied by: Joe Zamora on 22-12-2011 06:08:24 PM
Sorry, that last one didn't show up well.

log4j.rootLogger=DEBUG, testApp

log4j.logger.your.package.here=DEBUG
log4j.logger.org.apache.axis=DEBUG
log4j.logger.org.apache.axis.encoding=INFO
log4j.logger.org.apache.axis.utils=INFO
log4j.logger.org.apache.axis.message=INFO
log4j.logger.org.apache.axis.i18n=INFO

log4j.appender.testApp=org.apache.log4j.RollingFileAppender
log4j.appender.testApp.File=C:\temp\mytomcatdebug.log
log4j.appender.testApp.layout=org.apache.log4j.PatternLayout
log4j.appender.testApp.layout.ConversionPattern=%t %-5p %c{2} - %m%n
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links