With Tomcat, it is possible to dump a pile of interesting information to the a logfile by configuring the appropriate valve.
For example:
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost."
suffix=".txt"
pattern='%s %b %I %{myname}s'
resolveHosts="false"/>
means:
- %s - output HTTP status code of the response
- %b - output Bytes sent,excluding HTTP headers, or '-' if zero
- %I - threadId
and %{myname}s meaning output the value of the attribute myname stored on the session.
All good. If I have a hashmap stored on my session, I can output by doing something like:
%{mymap}s
See http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html for more info.
But, I want to just output a value for a specific key, not the entire map. I have tried:
%{mymap.myatt}s
But this does not work. Any ideas how to do this?