We need to capture the HTTP Client trace to debug any issues while interacting with end HTTP server.
Issue/Introduction
How to log HTTP Client Headers and Body in BW?
Resolution
A. If using "Apache HttpComponents(Supported by HTTP and REST)" in HTTP Client Resource then to log those requests follow the below mentioned steps:
1. If testing in Studio: Add the following property at the end of Run/Debug Configuration>Arguments>VM Arguments: >>>>>>>>>>> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG -Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=DEBUG >>>>>>>>>>>
2. If testing in Deployed environment:
Add the following property in appnode tra file present under <BW_HOME>\bw\<BW_VERSION>\domains\<DOMAIN_NAME>\appnodes\<APPSPACE_NAME>\<APPNODE_NAME>\bin directory: >>>>>>>>>> java.extended.properties=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG -Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=DEBUG >>>>>>>>> If java.extended.properties is already used append the above properties at the end.
B.If using "Apache Commons(Supported by HTTP and SOAP)" in HTTP Client Resource then to log those requests follow the below mentioned steps:
1. If testing in Studio: Add the following property at the end of Run/Debug Configuration>Arguments>VM Arguments: >>>>>>>>>>> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=DEBUG -Dorg.apache.commons.logging.simplelog.log.httpclient.wire.content=DEBUG -Dorg.apache.commons.logging.simplelog.log.httpclient.wire.header=DEBUG >>>>>>>>>>>
2. If testing in Deployed environment:
Add the following property in appnode tra file present under <BW_HOME>\bw\<BW_VERSION>\domains\<DOMAIN_NAME>\appnodes\<APPSPACE_NAME>\<APPNODE_NAME>\bin directory: >>>>>>>>>> java.extended.properties=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=DEBUG -Dorg.apache.commons.logging.simplelog.log.httpclient.wire.content=DEBUG -Dorg.apache.commons.logging.simplelog.log.httpclient.wire.header=DEBUG >>>>>>>>> If java.extended.properties is already used append the above properties at the end.
Note: As Simple implementation of Log(org.apache.commons.logging.impl.SimpleLog) sends all enabled log messages, for all defined loggers, to System.err, please start the appnode using nohup or start the appnode from command prompt and redirect its output to a file
Also note that above properties will generate lot of logging and should be used only for debugging issues.
Note: If using BW 6.5.x or higher you will need to comment out the "org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog" present in the <APPNODE_HOME>/config.ini for logs to get generated