]> granicus.if.org Git - apache/commitdiff
Add in useful feature. %k which logs the keepalives
authorJim Jagielski <jim@apache.org>
Mon, 8 Sep 2008 14:52:21 +0000 (14:52 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 8 Sep 2008 14:52:21 +0000 (14:52 +0000)
value.
PR: 45762
        Dan Poirier <poirier@pobox.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693120 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 ed02d2bdab57ed04644df839b98634dbbbf80305..7b73618800d431f415dd9fc227fe866c5400a6f7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) Add new LogFormat parameter, %k, which logs the number of
+     keepalive requests on this connection for this request..
+     [Dan Poirier <poirier pobox.com>]
+
   *) Be tolerant in what you accept - accept slightly broken
      status lines from a backend provide they include a valid status code.
      PR 44995 [Rainer Jung <rainer.jung kippdata.de>
index 27c855c240d8e9de10c6097b04bfa05fce0d1c3b..161314071b0876099715076e8a6c05ae9c0ce2db 100644 (file)
         <td>The contents of <code><var>Foobar</var>:</code> header line(s)
         in the request sent to the server.</td></tr>
 
+    <tr><td><code>%k</code></td>
+        <td>Number of requests handled on this connection.  Interesting if
+          <directive module="core">KeepAlive</directive> is being used;
+          otherwise this is always 0.</td></tr>
+
     <tr><td><code>%l</code></td>
         <td>Remote logname (from identd, if supplied). This will return a
         dash unless <module>mod_ident</module> is present and <directive
index 6b3e3259e44def1e09e7383c9cb581208f87b770..c54859e53ee51d65c418c854b775d6b2a7cf8290 100644 (file)
@@ -87,6 +87,7 @@
  * %...A:  local IP-address
  * %...{Foobar}i:  The contents of Foobar: header line(s) in the request
  *                 sent to the client.
+ * %...k:  number of requests served over this connection
  * %...l:  remote logname (from identd, if supplied)
  * %...{Foobar}n:  The contents of note "Foobar" from another module.
  * %...{Foobar}o:  The contents of Foobar: header line(s) in the reply.
@@ -694,6 +695,11 @@ static const char *log_connection_status(request_rec *r, char *a)
     return "-";
 }
 
+static const char *log_requests_on_connection(request_rec *r, char *a)
+{
+    return apr_itoa(r->pool, r->connection->keepalives);
+}
+
 /*****************************************************************
  *
  * Parsing the log format string
@@ -1498,6 +1504,7 @@ static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
         log_pfn_register(p, "q", log_request_query, 0);
         log_pfn_register(p, "X", log_connection_status, 0);
         log_pfn_register(p, "C", log_cookie, 0);
+        log_pfn_register(p, "k", log_requests_on_connection, 0);
         log_pfn_register(p, "r", log_request_line, 1);
         log_pfn_register(p, "D", log_request_duration_microseconds, 1);
         log_pfn_register(p, "T", log_request_duration, 1);