Bug 54015 - Combined (bytes received + bytes sent) logging directive
Summary: Combined (bytes received + bytes sent) logging directive
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_logio (show other bugs)
Version: 2.2.23
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: FixedInTrunk
Depends on:
Reported: 2012-10-16 19:35 UTC by Martijn T.
Modified: 2013-10-02 15:49 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Martijn T. 2012-10-16 19:35:57 UTC
mod_logio currently adds two logging directives: %I for bytes received (in) and %O for bytes sent (out). They are very handy in several situations. However, many packages that help the user translate the access logs into statistics, only provide for a single 'byte counter' when reading access_log, as by popular and accepted log formats.

Before mod_logio was available this counter was usually used to count %b, which doesn't include received bytes, and is inaccurate on partial downloads (it implies '100 MB sent' when a 100 MB file download is cancelled after 5 MB for example).

It seems that some distributions (at least Ubuntu) now include %O instead of %b to accurately record true sent bytes, but this still completely leaves out received bytes.

I would like to suggest adding a logging directive that has the cumulative result of %I and %O so that:
- sent and received data can be measured with the currently available packages for statistics;
- this data can be recorded with those tools, without adding extra columns/data to the already available and well accepted log formats.
Comment 1 Martijn T. 2012-10-17 10:06:52 UTC
I forgot: wasn't sure what version I should put this on. I would certainly like to see this in currently maintained versions of Apache.

Mostly because it is a more elegant way (perhaps also faster and less error prone) of getting the sum of in+out than piping all our logs (with seperate %I and %O) through a Perl script just to combine the two values.
Comment 2 Christophe JAILLET 2013-05-21 19:28:10 UTC
A patch that adds a new %C (combined) format specifier has been pushed to trunk.

See r1484910.
Comment 3 Christophe JAILLET 2013-10-02 15:49:52 UTC
This has been backported to 2.4.X branch in r1523269.

It will be part of 2.4.7