[Mod_log_sql] X-Forwarded-For headers?

Edward Rudd urkle at outoforder.cc
Sun Aug 8 23:38:16 EST 2004


Quoting Paul Chvostek <paul+modlogsql at it.ca>:

> Heya.
> 
> I'm trying to get mod_log_sql running on a web server behind a proxy
> (Pound, from http://apsis.ch/pound/).  The proxy correctly sends the
> X-Forwarded-For header lines to indicate the original requestor, so in
> the bad-old-days, I built my combined logs with:
> 
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
> 
> Now...  how do I get out of the bad-old-days?  Section 3.6.17 of the
> version 1.18 documentation (I'm using Apache 1.3) doesn't mention the
> X-Forwarded-For header, nor is it mentioned in the equivalent unnumbered
> section of the docs for 2.0.  I also can't find anything that would
> allow me to specify additional headers myself.
> 
You can use the LogSQLWhichHeadersIn to log that header, be sure to also log
Unique ID (from mod_unique_id) Another alternative, mod_log_sql 1.9x only,
would be to write a sub-module for mod_log_sql to log the x-forwarded-for
header into a new field. Look at the source code for mod_log_sql_ssl.c for an
example.

> Am I missing something obvious, or am I really making a feature request?
> Given the benefits of mod_log_sql for aggregating the log data of a farm
> of web servers, support for X-Forwarded-For would seem like an obvious
> requirement.  :)

I would categorize this under feature request.
I will look into adding this into the core distribution.. I am working on
redoing some of the code to determine what is logged.. as the current setup is
rather cumbersome.


Edward Rudd <urkle at outoforder.cc>
Web Page <http://www.outoforder.cc/>



More information about the Mod_log_sql mailing list