tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: How best to get some data from a Servlet to Apache access log. . .
Date Sat, 02 Oct 2010 19:00:18 GMT
On 02.10.2010 20:40, David Dabbs wrote:
> Hello.
> I'm running Tomcat fronted by Apache httpd via mod_proxy_ajp.
> There's a small bit of data from my Servlet response I'd like to
> get into the Apache access_log.
> I know I could set a response header, say X-MyData, and log
> that using a CustomLog directive. But I don't want this header
> cruft going out with the response from Apache. Would I use mod_headers
> to remove this header (and yet still log to access_log)?
> Another possibility is to use a "note," which I can also log
> using CustomLog. It's not clear though, how I would set this note
> using the Response obj available to my servlet code and have it
> propagate back through AJP.
> Looking for the best way to skin this cat.

Notes can only be set from within an Apache module. A response header is 
the only thing that survives passing the response from Tomcat to Apache. 
And yes, you should be able to remove the header with mod_headers, but: 
I would expect that the header is then gone for Apache mod_log_config to :(

Would it suffice to log things in a Tomcat access log (can log e.g. 
request attributes, which are not sent to the client), and generate a 
unique ID there that you send back to Apache (and the client) and log 
there too, so that you can correlate one to one?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message