Try OpenEdge Now
skip to main content
Administration
REST Administration : REST Web Application Administration : Managing REST Web applications : Debugging HTTP messages of a REST Web application : Enabling HTTP message dumping
 
Enabling HTTP message dumping
For dumping HTTP request and response messages, you add the RequestDumperFilter configurations to your Tomcat Web server instance where your REST Web application is hosted. Then, you enable your REST Web application to allow for its HTTP request and response messages dumping.
Note: Enabling HTTP message dumping is a REST Web application performance and security concern. Progress recommends that you enable this only for debugging purposes.
To enable HTTP message dumping:
1. Take a back-up of the Web server’s logging.properties file and the REST application’s web.xml file by executing the following commands:
cp %DLC%\servers\tomcat\conf\logging.properties
%DLC%\servers\tomcat\conf\logging.properties.orig
cp %CATALINA_BASE%\webapps\<REST_Web_Application_Name>\WEB-INF\web.xml
%DLC%\servers\tomcat\conf\web.xml.orig
These backup files are used when you want to disable HTTP message debugging.
2. If you are using the Tomcat Web server installed with Progress Developer Studio for OpenEdge, then open the logging.properties file from %DLC%\servers\tomcat\conf\ in a text editor, and locate the following lines of code:
############################################################
# RequestDumperFilter Configuration.
# Dumps the HTTP request and response
############################################################
# To see the HTTP request and response dump, uncomment the below lines
# NOTE: To enable dumping of HTTP request & response, you will also need to
# uncomment the OERequestDumperFilter section in the web.xml of the web
application
# that you want to debug.

#5request-dumper.org.apache.juli.FileHandler.level = FINEST
#5request-dumper.org.apache.juli.FileHandler.directory =
${openedge.weblogs}
#5request-dumper.org.apache.juli.FileHandler.prefix = request-dumper.
#5request-dumper.org.apache.juli.FileHandler.formatter =
org.apache.juli.VerbatimFormatter
## The level must be set at least to INFO. If you want to dump the body
also, set it to FINEST
#org.apache.catalina.filters.RequestDumperFilter.level = INFO
#org.apache.catalina.filters.RequestDumperFilter.handlers =
5request-dumper.org.apache.juli.FileHandler
Uncomment the request-dumper related lines of code. After uncommenting, the code block must be:
############################################################
# RequestDumperFilter Configuration.
# Dumps the HTTP request and response
############################################################
# To see the HTTP request and response dump, uncomment the below lines
# NOTE: To enable dumping of HTTP request & response, you will also need to
# uncomment the OERequestDumperFilter section in the web.xml of the web application
# that you want to debug.

5request-dumper.org.apache.juli.FileHandler.level = FINEST
5request-dumper.org.apache.juli.FileHandler.directory = ${openedge.weblogs}
5request-dumper.org.apache.juli.FileHandler.prefix = request-dumper.5request-dumper.org.apache.juli.FileHandler.formatter = org.apache.juli.VerbatimFormatter
## The level must be set at least to INFO. If you want to dump the body also, set it to FINEST
org.apache.catalina.filters.RequestDumperFilter.level = INFO
org.apache.catalina.filters.RequestDumperFilter.handlers = 5request-dumper.org.apache.juli.FileHandler
3. If you are using a Tomcat Web server other than the one installed with Progress Developer Studio for OpenEdge, then you must modify the logging.properties file from $CATALINA_BASE\tomcat\conf\ in a text editor to enable HTTP message dumping.
The following is an example of an edited logging.properties file that you can use to edit your Web server’s logging.properties file:
# To this configuration below, 1request-dumper.org.apache.juli.FileHandler
# also needs to be added to the handlers property near the top of the file
1request-dumper.org.apache.juli.FileHandler.level = INFO
1request-dumper.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1request-dumper.org.apache.juli.FileHandler.prefix = request-dumper.
1request-dumper.org.apache.juli.FileHandler.formatter = org.apache.juli.VerbatimFormatter
# Change the level from INFO to FINEST if you want to dump the HTTP body as well
org.apache.catalina.filters.RequestDumperFilter.level = INFO
org.apache.catalina.filters.RequestDumperFilter.handlers = \
1request-dumper.org.apache.juli.FileHandler
For more information on configuring the logging.properties file, see the Tomcat documentation at http://tomcat.apache.org/tomcat-7.0-doc/logging.html.
4. Optionally, if you want to dump both the request and response body of the HTTP message, then change the RequestDumperFilter.level from INFO to FINEST in the logging.properties file:
org.apache.catalina.filters.RequestDumperFilter.level = FINEST
5. Open the web.xml file of your REST Web application from %CATALINA_BASE%\webapps\<REST_Web_Application_Name>\WEB-INF\, and locate the following lines of code:
<!-- USER EDIT: uncomment OERequestDumperFilter section to enable
debugging of HTTP Request/Response -->
<!-- NOTE You must also uncomment RequestDumperFilter Configuration
section in $CATALINA_HOME/conf/logging.properties file to redirect the
debug messages to ${openedge.weblogs}/request-dumper.<date>.log file.
${openedge.weblogs} is set to OpenEdge WRKDIR by default -->

<!--
<filter>
<display-name>OERequestDumperFilter</display-name>
<filter-name>OERequestDumperFilter</filter-name>
 <filter-class>com.progress.rest.adapters.oe.OERequestDumperFilter
  </filter-class>
</filter>

<filter-mapping>
  <filter-name>OERequestDumperFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
-->
Uncomment the OERequestDumperFilter related lines of code. After uncommenting, the code-block must be:
<!-- USER EDIT: uncomment OERequestDumperFilter section to enable
debugging of HTTP Request/Response -->
<!-- NOTE You must also uncomment RequestDumperFilter Configuration
section in $CATALINA_HOME/conf/logging.properties file to redirect the
debug messages to ${openedge.weblogs}/request-dumper.<date>.log file.
${openedge.weblogs} is set to OpenEdge WRKDIR by default -->

<filter>
  <display-name>OERequestDumperFilter</display-name>
  <filter-name>OERequestDumperFilter</filter-name>
  <filter-class>com.progress.rest.adapters.oe.OERequestDumperFilter
  </filter-class>
</filter>

<filter-mapping>
  <filter-name>OERequestDumperFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
After enabling the HTTP message dumping, all the HTTP request and response messages will be logged in the request-dumper.<date>.log file, which is located in the OpenEdge WRKDIR by default. You can use the logs in this file for debugging purposes.