mP.
mP.

Reputation: 18266

Filter that dumps HttpServletRequest & Response to files

Im after something that watches all requests/responses and when triggered then writes several dump files such as

it should use a common unique prefix for the set of files that it dumps. This naming should be configurable.

Upvotes: 1

Views: 1331

Answers (1)

Carlos Jaime C. De Leon
Carlos Jaime C. De Leon

Reputation: 2896

If you are using Tomcat, you can use the RequestDumperValve. Enable it by opening the server.xml and uncommenting it out as instructed in there:

<!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> -->

It seems like it addresses some (if not all) of your requirements. For more information check this out (which also mentions RequestDumperFilter, but I have not used that before)

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Request_Dumper_Valve

Logs appear in the TOMCAT_HOME\logs\catalina file

One last note though, I only used in Non-PRD environment, as it has performance impact as the comments in the server.xml will warn you...

Upvotes: 3

Related Questions