httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57710] New: [PATCH] Wildcard matching for logging headers
Date Sun, 15 Mar 2015 14:12:54 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=57710

            Bug ID: 57710
           Summary: [PATCH] Wildcard matching for logging headers
           Product: Apache httpd-2
           Version: 2.4.12
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_log_config
          Assignee: bugs@httpd.apache.org
          Reporter: peter@pramberger.at

I recently got the requirement to log all X-* headers in some sort of
"mass-hosting" setup, where the header names are not known beforehand.

Unfortunately this is something not possible yet. While mod_log_forensic
provides the possibility to dump headers, it is limited to all the request
headers (sent by client), and which headers to log is not configurable.

So it would be great to allow for the use of wildcards in the %{...}i and
%{...}o log formats.

Fortunately find_multiple_headers() in mod_log_config.c does already most of
the work required for this, so extending it is not a big issue. Please have a
look at the attached patches, they should apply cleanly to the 2.4 and 2.2
branches.

Using wildcards will prefix its header value with the header name, while
non-wildcard header names keep the ususal value-only output. For example using
LogFormat "\"%{*}o\"" to log all response headers would produce something like
this in the access log:

"Vary: User-Agent, Content-Length: 4330, Keep-Alive: timeout=60, max=100,
Connection: Keep-Alive, Content-Type: text/html; charset=ISO-8859-1"

Note that I tried to keep the overhead as low as possible for the usual
non-wildcard use case, but there is probably room for optimization.

Would be great if you could review the patches (luckily the logging
infrastructure in 2.2 and 2.4 is identical in this case) and maybe include them
in the 2.2 and 2.4 branches.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message