httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg v. Zezschwitz" <>
Subject ResponseHeaders to Environment
Date Fri, 21 Nov 2008 17:00:54 GMT

I am uncertain if I should write my own "private" module or extends an  
existing Apache module.

I used to have in the past the situation that I wanted to log request  
headers, but did not want to pass them
to the backend by mod_proxy.

This is possible by first exporting the request header value to the  
environment, then dropping the
request header and logging the environment variable.

Now I need the other way round: The backend server (Tomcat) shall set  
several headers in
the response for logging purposes in the Apache log, but these headers  
should not be sent to the
(poor mobile) client. Using mod_headers intercepts too early: If  
"Header unset" is used, the
response header will not be accessible in a LogFormat "%{my-output- 
header}o" form.

So, I am looking for a method to transfer response header values to  
the environment and
log them with a "%{my-output-header}e" directive.

One approach would be to modify "mod_setenvif' by a "SetEnvIfLate"  
that also refers
to response headers.

Another approach would be to extend mod_env by a
	PassEnvRequestHeader <header1> <header2> <header..n>
	PassEnvResponseHeader <header1> <header2> <header..n>

I consider both approaches not being really beautiful... Any better  

Anyway, is my extension too exotic?

For a better understanding:
The backend application is a mobile rendering proxy. I want to log:
   - the actual URL that was fetched by the request
   - if the customer got an error message: The error message
   - the customer identity

Best regards,


View raw message