I trying to investigate how often a particular HTTP request is getting send to a web site. The request is a POST and has a parameter named "_method"
. I can see this in firebug getting net over.
I need to check the value of this "_method"
parameter, so following the documentation http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve I add the following to the tomcat access configuration for the valve
%{_method}r
But it is not coming out in access logs.
I wonder is that because of the underscore?
Note, the parameter name cannot be changed.
OK, What I had to do was use the ExtendedAccessLogValve.
I added the below to my server.xml
<Valve className="org.apache.catalina.valves.ExtendedAccessLogValve" directory="logs" pattern="c-dns x-H(remoteUser) date time cs-method cs-uri x-H(protocol) sc-status bytes x-P(_method)" prefix="localhost_extended_access_log." resolveHosts="false" suffix=".txt"/>
The part x-P(_method)
is the crucial part which gave it to me.
I am including answer for any on-lookers.
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