Ticket #2187 (closed defect: fixed)
apache logger should be able to use the improvements of logio in http accounting
| Reported by: | aseques | Owned by: | nuxwin |
|---|---|---|---|
| Priority: | critical | Milestone: | ispCP ω 1.0.7 |
| Component: | Backend (Engine) | Version: | ispCP ω trunk |
| Severity: | Medium | Keywords: | |
| Cc: |
Description
There's a module for apache (normally build-in) that gives us two new variables on our logs. %I %O. With the attached patch, instead of writing %b into /var/log/apache2/example.com.traf, we write %I+%O, wich is exactly the amount downloaded/uploaded for the client.
More info here: http://www.isp-control.net/forum/thread-8721.html
Attachments
Change History
comment:1 Changed 2 years ago by aseques
Another (better) approach would be to create a regexp that could handle both a LogFile? with %I %O or without them, so we hadn't to add another option on ispcp.conf
comment:2 Changed 2 years ago by kilburn
- Owner set to kilburn
- Status changed from new to assigned
Hey aseques, could you please post the "CustomLog?" directive that you use with this patch? Thanks!
comment:3 Changed 2 years ago by aseques
This is the relevant section:
#
# Log processing.
#
LogFormat "%B" traff
LogFormat "%v %b %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" ispcplog
CustomLog "| /var/www/ispcp/engine/ispcp-apache-logger" ispcplog
ErrorLog "| /var/www/ispcp/engine/ispcp-apache-logger -e"
As you can see, the only changes in apache2/ispcp.conf are the added %I %O
Changed 2 years ago by kilburn
-
attachment
logio-for-debian.patch
added
Patch to enable mod_logio accounting in debian (must ispcp-update to make it effective)
comment:5 Changed 2 years ago by benedikt
- Priority changed from major to patch
which of the patches should be applied? any modules needed?
comment:6 Changed 2 years ago by aseques
I am reworking the patch, so there's no need to put a new variable in ispcp.conf and at the same time have backwards compatibility. When I am at job on monday I will post the patch.
comment:7 Changed 2 years ago by aseques
I updated the attachment, with the ALMOST working patch.
Basically, it consists in two parts:
.- The change for the httpd.conf (logio is compiled build-in in most distros, also de *BSD ones) so logio is enabled by default.
.- The regexp that, in case there is %I %O values, agregates them and use them as $size, in case that there isnt' %I %O values, the $size will be the one reported by apache.
The problem is that currently the regexp is working fine when there's no %I %O, but the numbers are not correct when using the logio. Probably someone with stronger abilities in regexp + perl will spot the problem
comment:8 Changed 2 years ago by aseques
I've been looking for the dates when the logio was incorportated. This is what I found so far, with this ones it should be working without problems and without enabling anything. Debian lenny --enable-logio=static Ubuntu hardy --enable-logio Ubuntu > hardy: --enable-logio=static
I also recall that on *BSD was build/enabled by default
comment:10 Changed 2 years ago by aseques
I've tested the patch by kilburn and it works fine on my systems. Hope it will make into trunk soon.
comment:11 Changed 21 months ago by nuxwin
@Benedikt: Please, patch the trunk (single commit for it). So we can test the behavior and revert back changes easily if necessary. Thank
comment:12 Changed 21 months ago by benedikt
- Owner changed from kilburn to benedikt
- Status changed from assigned to new
I will take care of it
comment:13 Changed 18 months ago by benedikt
- Status changed from new to assigned
- Type changed from enhancement to defect
comment:14 Changed 18 months ago by benedikt
- Status changed from assigned to closed
- Resolution set to fixed
After I checked some distributions, I think every distribution has logio compiled into apache. If not, testers should write a ticket in RC testing stage on error.
added in r3201
comment:15 Changed 18 months ago by vanshyr
- Status changed from closed to reopened
- Resolution fixed deleted
comment:16 Changed 18 months ago by vanshyr
The regexp don't matches the new variables
comment:17 Changed 18 months ago by nuxwin
- Owner changed from benedikt to nuxwin
- Status changed from reopened to new
comment:19 Changed 18 months ago by nuxwin
- Priority changed from patch to critical
- Severity changed from Don't know to Medium
New version of the ispcp-apache-logger will be committed today.
Note: Sorry, I've reopen the ticket with login credentials that I've created for another user...
comment:20 Changed 18 months ago by nuxwin
- Status changed from assigned to closed
- Resolution set to fixed
See r3227


