From: Graham Leggett Date: Sat, 27 Feb 2010 18:43:16 +0000 (+0000) Subject: Backport: X-Git-Tag: 2.2.15~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5e97708fa4e9cc5048f96772a9c73a3862177bc;p=thirdparty%2Fapache%2Fhttpd.git Backport: mod_log_config: Add the R option to log the handler used within the request. Submitted by: Christian Folini +1: minfrin, jim, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@917009 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 572a21f1693..8bd959e5250 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,9 @@ Changes with Apache 2.2.15 access control is still vulnerable, unless using OpenSSL >= 0.9.8l. [Joe Orton, Ruediger Pluem, Hartmut Keil ] + *) mod_log_config: Add the R option to log the handler used within the + request. [Christian Folini ] + *) Allow fine control over the removal of Last-Modified and ETag headers within the INCLUDES filter, making it possible to cache responses if desired. Fix the default value of the SSIAccessEnable directive. diff --git a/STATUS b/STATUS index 5e26154f261..cc67a83d757 100644 --- a/STATUS +++ b/STATUS @@ -87,13 +87,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_log_config: Add the R option to log the handler used within the - request. - Submitted by: Christian Folini - Trunk patch: http://svn.apache.org/viewvc?rev=905420&view=rev - Trunk works for 2.2.x - +1: minfrin, jim, rpluem - * mod_proxy_http: Make sure that when an ErrorDocument is served from a reverse proxied URL, that the subrequest respects the status of the original request. This brings the behaviour of proxy_handler diff --git a/docs/manual/mod/mod_log_config.xml b/docs/manual/mod/mod_log_config.xml index 9d5b920f494..b030f98d059 100644 --- a/docs/manual/mod/mod_log_config.xml +++ b/docs/manual/mod/mod_log_config.xml @@ -159,6 +159,9 @@ %r First line of request + %R + The handler generating the response (if any). + %s Status. For requests that got internally redirected, this is the status of the *original* request --- %>s @@ -267,6 +270,11 @@ format provided by mod_logio will log the actual number of bytes sent over the network.

+

Note: mod_cache is implemented as a + quick-handler and not as a standard handler. Therefore, the + %R format string will not return any handler + information when content caching is involved.

+
Examples diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 60485dd3cd0..8ceadf7c039 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -381,6 +381,11 @@ static const char *log_status(request_rec *r, char *a) return pfmt(r->pool, r->status); } +static const char *log_handler(request_rec *r, char *a) +{ + return ap_escape_logitem(r->pool, r->handler); +} + static const char *clf_log_bytes_sent(request_rec *r, char *a) { if (!r->sent_bodyct || !r->bytes_sent) { @@ -1516,6 +1521,7 @@ static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) log_pfn_register(p, "T", log_request_duration, 1); log_pfn_register(p, "U", log_request_uri, 1); log_pfn_register(p, "s", log_status, 1); + log_pfn_register(p, "R", log_handler, 1); } return OK;