RequestDumperFilter (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.catalina.filters, class: RequestDumperFilter

# Class RequestDumperFilter

java.lang.Object
jakarta.servlet.GenericFilter
org.apache.catalina.filters.RequestDumperFilter

All Implemented Interfaces:
  `Filter, FilterConfig, Serializable`

public class RequestDumperFilter extends GenericFilter

Implementation of a Filter that logs interesting contents from the specified Request (before processing) and the corresponding Response (after processing). It is especially useful in debugging problems related to headers and cookies.

When using this Filter, it is strongly recommended that the `org.apache.catalina.filter.RequestDumperFilter` logger is directed to a dedicated file and that the `org.apache.juli.VerbatimFormatter` is used.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RequestDumperFilter()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `doFilter(ServletRequest request, ServletResponse response, FilterChain chain)`
  Log the interesting request parameters, invoke the next Filter in the sequence, and log the interesting response parameters.

  ### Methods inherited from class GenericFilter

  `getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init, init`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Filter

  `destroy`

- ## Constructor Details

  - ### RequestDumperFilter

    public RequestDumperFilter()
    Default constructor.

- ## Method Details

  - ### doFilter

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
    Log the interesting request parameters, invoke the next Filter in the sequence, and log the interesting response parameters.
    Parameters:
      `request` - The servlet request to be processed
      `response` - The servlet response to be created
      `chain` - The filter chain being processed
    Throws:
      `IOException` - if an input/output error occurs
      `ServletException` - if a servlet error occurs