You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2013/05/21 21:26:11 UTC
svn commit: r1484910 - in /httpd/httpd/trunk: CHANGES
docs/manual/mod/mod_log_config.xml docs/manual/mod/mod_logio.xml
modules/loggers/mod_logio.c
Author: jailletc36
Date: Tue May 21 19:26:10 2013
New Revision: 1484910
URL: http://svn.apache.org/r1484910
Log:
mod_logio: new format-specifier %C (combined) which is the sum of received and sent byte counts. PR54015
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/docs/manual/mod/mod_log_config.xml
httpd/httpd/trunk/docs/manual/mod/mod_logio.xml
httpd/httpd/trunk/modules/loggers/mod_logio.c
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1484910&r1=1484909&r2=1484910&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue May 21 19:26:10 2013
@@ -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]
Modified: httpd/httpd/trunk/docs/manual/mod/mod_log_config.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_log_config.xml?rev=1484910&r1=1484909&r2=1484910&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_log_config.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_log_config.xml Tue May 21 19:26:10 2013
@@ -254,6 +254,12 @@
<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>
Modified: httpd/httpd/trunk/docs/manual/mod/mod_logio.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_logio.xml?rev=1484910&r1=1484909&r2=1484910&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_logio.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_logio.xml Tue May 21 19:26:10 2013
@@ -61,12 +61,16 @@
<tr><th>Format 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>
Modified: httpd/httpd/trunk/modules/loggers/mod_logio.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_logio.c?rev=1484910&r1=1484909&r2=1484910&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_logio.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_logio.c Tue May 21 19:26:10 2013
@@ -108,6 +108,14 @@ static const char *log_bytes_out(request
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 *
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;