Configuring logging for Web Services Client adapter
To configure logging for a Web Services Client adapter, modify the APAMA_HOME/adapters/config/adapters-log4j.properties file. The default logging level for the properties listed in this file is INFO. The com.progress.el package contains the mapping framework. Possible logging levels are INFO, WARN, ERROR, DEBUG, and TRACE.
If you want you can place this file in another location or use a different name for this file. If you do then be sure to update the value of the log4j.configuration property in the Web Services Client adapter's IAF configuration file. This is the line you need to change:
<property name="log4j.configuration"
value="file:///@APAMA_HOME@/adapters/config/adapters-log4j.properties"/>
In addition to general adapter logging, you can configure payload logging. Payload logging can help you diagnose problems by indicating what the constructed request and responses looks like, which can point to whether a problem is in the tooling part of your application or in the runtime execution.
The steps below show how to configure payload logging for a convention-based mapping such as the following:
To configure payload logging
1. In the Project Explorer toolbar, click View Menu () and select Customize View. This displays the Available Customizations dialog.
2. In the Filters tab, ensure that the .*resources checkbox is not selected. Click OK.
The .services folder now appears in the project's hierarchy in the Project Explorer.
3. For the operation for which you want to enable payload logging, in the project's hierarchy in Project Explorer, open the XML file for the operation's route statement. For the mapping shown in the image at the beginning of these instructions, you would select the StockQuote_StockQuoteSoap_GetQuote_route.xml file.
4. In the operation's _route.xml file, add the following lines just after the <cxf.properties> section:
<cxf:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</cxf:features>
For example:
<cxf:cxfEndpoint
. . .>
<cxf:properties>
<entry key="mtom-enabled"
value="${CXF_mtom_enabled_StockQuote_StockQuoteSoap_GetQuote_route}"/>
<entry key="dataFormat"
value="${CXF_dataFormat_StockQuote_StockQuoteSoap_GetQuote_route}"/>
</cxf:properties>
<cxf:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</cxf:features>
</cxf:cxfEndpoint>
5. In the APAMA_HOME/adapters/config/adapters-log4j.properties file, change the default INFO setting for log4j.logger.org.apache.cxf to the logging level you want.
After you invoke the operation you specified payload logging for, the iaf.log file for the Web Services Client adapter displays something like the following:
---------------------------------
ID: 1
Address: http://www.webservicex.net/stockquote.asmx
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=["http://www.webserviceX.NET/GetQuote"], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body><GetQuote xmlns="http://www.webserviceX.NET/">
<symbol>APMA</symbol></GetQuote></soap:Body></soap:Envelope>
---------------------------------