Is it possible to print all requests to Tomcat and responses from Tomcat in a logfile?
ex:
request
headers: [header1=a, header2=a]
params: [param1=avv, param2=b]
response
status-code = 200
response = its works
https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter
The Request Dumper Filter logs information from the request
and response
objects and is intended to be used for debugging purposes.
The following entries in a web application's web.xml
would enable the Request Dumper filter for all requests for that web application.
If the entries were added to CATALINA_BASE/conf/web.xml
, the Request Dumper Filter would be enabled for all web applications
.
<filter>
<filter-name>requestdumper</filter-name>
<filter-class>
org.apache.catalina.filters.RequestDumperFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>requestdumper</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With