]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_log_config: Add the R option to log the handler used within the
authorGraham Leggett <minfrin@apache.org>
Mon, 1 Feb 2010 21:38:15 +0000 (21:38 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 1 Feb 2010 21:38:15 +0000 (21:38 +0000)
request.
Submitted by: Christian Folini <christian.folini netnea com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@905420 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_log_config.xml
modules/loggers/mod_log_config.c

diff --git a/CHANGES b/CHANGES
index 7c29c5e81f89fe30f700ce1bae38e499ced87d4c..7be8e53ba26cd3a6b9b292b0e2d5cabe6bfcb7f9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.6
 
+  *) mod_log_config: Add the R option to log the handler used within the
+     request. [Christian Folini <christian.folini netnea com>]
+
   *) 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.
index 93071c48a6cf71ad9624dcf57ce5e1157444c2a7..ffbea81f2e0b7b1b1d1528b5ce9d290cbb55cefe 100644 (file)
     <tr><td><code>%r</code></td>
         <td>First line of request</td></tr>
 
+    <tr><td><code>%R</code></td>
+        <td>The handler generating the response (if any).</td></tr>
+
     <tr><td><code>%s</code></td>
         <td>Status. For requests that got internally redirected, this is
         the status of the *original* request --- <code>%&gt;s</code>
       format provided by <module>mod_logio</module> will log the
       actual number of bytes sent over the network.</p>
 
+      <p>Note: <module>mod_cache</module> is implemented as a
+      quick-handler and not as a standard handler. Therefore, the
+      <code>%R</code> format string will not return any handler
+      information when content caching is involved.</p>
+
     </section>
 
     <section id="examples"><title>Examples</title>
index 51516650e8e4296f3d56567a5ce6352280e8b737..f145d561760b24a3e91924e7a345d39f93cbe2e5 100644 (file)
@@ -376,6 +376,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) {
@@ -1530,6 +1535,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;