]> granicus.if.org Git - apache/commitdiff
mod_logio: new format-specifier %C (combined) which is the sum of received and sent...
authorChristophe Jaillet <jailletc36@apache.org>
Tue, 21 May 2013 19:26:10 +0000 (19:26 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Tue, 21 May 2013 19:26:10 +0000 (19:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1484910 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/CHANGES b/CHANGES
index 94ce4b77edc69e481ea99b0f0234c48c8b773346..41c503144d565b24330b3cf7eae37a9e6f674c6d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_logio: new format-specifier %C (combined) which is the sum of received
+     and sent byte counts.
+     PR54015 [Christophe Jaillet]
+
   *) core: Remove apr_brigade_flatten(), buffering and duplicated code
      from the HTTP_IN filter, parse chunks in a single pass with zero copy.
      Reduce memory usage by 48 bytes per request. [Graham Leggett]
index 6c17f7786ea523c540315164732d361a8304bf6b..a5a68cc1e7ca4dd996eefdf41330c7ba44831f84 100644 (file)
     <tr><td><code>%O</code></td>
         <td>Bytes sent, including headers. Cannot be zero. You need to
         enable <module>mod_logio</module> to use this.</td></tr>
+
+    <tr><td><code>%C</code></td>
+        <td>Bytes transferred (received and sent), including request and headers,
+        cannot be zero. This is the combination of %I and %O. You need to
+        enable <module>mod_logio</module> to use this.</td></tr>
+
     </table>
 
     <section id="modifiers"><title>Modifiers</title>
index 905b1eab205f269dd065b877e6bfadce646b76ba..7accb1ae38f2f9d56417e1d291047564735806d4 100644 (file)
     <tr><th>Format&nbsp;String</th>
         <th>Description</th></tr>
 
-    <tr><td><code>%...I</code></td>
+    <tr><td><code>%I</code></td>
         <td>Bytes received, including request and headers, cannot be
         zero.</td></tr>
 
-    <tr><td><code>%...O</code></td>
+    <tr><td><code>%O</code></td>
         <td>Bytes sent, including headers, cannot be zero.</td></tr>
+
+    <tr><td><code>%C</code></td>
+        <td>Bytes transferred (received and sent), including request and headers,
+        cannot be zero. This is the combination of %I and %O.</td></tr>
     </table>
 
     <p>Usually, the functionality is used like this:</p>
index f58c2922d3e9807308e062f1d840b65c15d535ce..c0ae7a11c634a079fb309269e7d2c1bd03cb8c0c 100644 (file)
@@ -108,6 +108,14 @@ static const char *log_bytes_out(request_rec *r, char *a)
     return apr_off_t_toa(r->pool, cf->bytes_out);
 }
 
+static const char *log_bytes_combined(request_rec *r, char *a)
+{
+    logio_config_t *cf = ap_get_module_config(r->connection->conn_config,
+                                              &logio_module);
+
+    return apr_off_t_toa(r->pool, cf->bytes_out + cf->bytes_in);
+}
+
 /*
  * Reset counters after logging...
  */
@@ -170,6 +178,7 @@ static int logio_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
     if (log_pfn_register) {
         log_pfn_register(p, "I", log_bytes_in, 0);
         log_pfn_register(p, "O", log_bytes_out, 0);
+        log_pfn_register(p, "C", log_bytes_combined, 0);
     }
 
     return OK;