Axis 2 Client logging http request and response
846107Mar 9 2011 — edited Mar 9 2011Hi All,
my application consumes a web service written in .NET.
and the client is java.
after doing lot of search and implementing different examples i here by write my problems with Axis2 client logging http request and response.
1) With axis it was easy to log http request and response into a separte file (other than normal application log).
but with Axis 2 it is not easy.
either we have to use -D options as mentioned at http://wso2.org/blog/dims/1554
or Manually get the messages from org.apache.axiom.soap.SOAPEnvelope class and write them into application log.
i am sucessful with the second approach mentioned above but here i have two problems.
a) my log4j configuration is debug level. (i have to keep it in debug level because only then i was able to get http request and responses) and axis2 writes lot of logger messages which really unnecessarliy populates my application log. The messages are as follows.
[Thread-16] DEBUG org.apache.axis.MessageContext - MessageContext: setServiceHandler(null)
[Thread-16] DEBUG org.apache.axis.SOAPPart - Enter: SOAPPart::getAsSOAPEnvelope()
[Thread-16] DEBUG org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(currForm)
[Thread-16] DEBUG org.apache.axis.SOAPPart - current form is FORM_SOAPENVELOPE
[Thread-16] DEBUG org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(register00)
[Thread-16] DEBUG org.apache.axis.encoding.SerializationContext - register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
[Thread-16] DEBUG org.apache.axis.utils.NSStack - NSPush (32)
[Thread-16] DEBUG org.apache.axis.utils.NSStack - NSPush (32)
i have extracted only some lines thinking this would give you an idea of what kind of logger messages i am talking about.
b) second problem is i want to route the http response and request to another file not to an application log. or should i create a file using java.io.File and write these messages into it?
any kind of hints are really appreciated.
Thank you in advance.