Reputation: 18266
Im after something that watches all requests/responses and when triggered then writes several dump files such as
request line url method etc
GET url HTTP/1.0
request headers with parameter k/v on a separate line
a=b c=d e=f
request post body, dump of the initial post data
ashdashdiuhasidahs diasdad
response status, on a single line
200 OK
response headers, each header appears on a separate line.
a=b c=dddd e=fff
response body, the written output as is.
asjiasjdoiajdo iajdaoi djaoidsjaod
it should use a common unique prefix for the set of files that it dumps. This naming should be configurable.
Upvotes: 1
Views: 1331
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