Search This Blog

Showing posts with label CXF. Show all posts
Showing posts with label CXF. Show all posts

Thursday, January 30, 2014

How to enable logging within CXF framework to trace SOAP inbound / outbound headers/requests and how it helped to figure out the problem of production incident

Recently surfaced with the problem in production with conflicts of web services calls , summarizing problem statement and troubleshooting approach :

Problem Statement :
Web service calls were not going through and giving 404 and reason was that something broken into header but enough information was not printing in log .

Troubleshooting Approach : Since we are using CXF framework hence more logging can be enabled which helped to figure out problem and we were able to fix problem with a tactical solution. Following are the steps which would help to trouble shoot Inbound and Outbound soap headers/requests of web services , It may help @ any point in time to discuss further with EIS team and to know the exact reason : Steps to enable logging :

Step 1 : Change in debug level ( in our case it is in local.propeties file) : Add following line in log4j section : log4j.logger.org.apache.cxf = INFO, FILE

Step 2 : Append highlighted (bold) JVM parameter . ( In our case it is in tomcat.generaloption property within properties file) :

tomcat.generaloptions=-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger

Step 3 : Change in cxfclient-beans.xml file ( a bean file as part of application ) Add highlighted line into cxf:bus tag :


Step 4 : Do following acitons :

a) stop the server ( tomcat in our case )
b) run ant deploy ( to redeploy JVM option in our case , you may or may not have it if place dirctly into server)
c) start the server ( Tomcat )

it's all done :)

Cheers 

Kapil

Popular Posts