proxy logging code

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1CBAA.07D59040
Content-Type: text/plain

Hello, I apologize if this issue has come up before, but I thought I would
run it by the list before proceeding with modifying the mod_proxy C code:

My organization uses the Apache proxy functionality pretty extensively, both
reverse and forward. There doesn't seem to be any way to log proxy transfer
information associated with a request to the access logs. We have some
Netscape proxies we want to retire and quite a bit of cache and throughput
performance monitoring based on the transfer logs that I can't seem to
duplicate with Apache. In particular, I need to log the following additional
request items:

. . . s2 c2 b1 b2 h1 h2 h3 h4 dnstm route

s2 - remote server status response
c2 - bytes served from remote host
b1 - client request body size
b2 - proxy request body size
h1 - client request header size
h2 - proxy response to client header size
h3 - proxy request to remote header size
h4 - remote response header size
dnstm - remote host DNS resolve time (ms), or "-" for ProxyRemote
forwards
route - "remoteproxy:port" or "-"

I believe the standard response to this issue is "why don't you just use
Squid?", and my response to that is that I don't want to unless I have to.
We are doing a lot of reverse-proxy virtual hosting along with caching, and
we like Apache just fine. The Apache performance is acceptable, etc. We also
use quite a bit of mod_perl. In the case of our old existing Netscape
proxies, I have quite a bit of NSAPI C code (access control system) I need
to rewrite, and I would prefer to code it using the Apache API. (And no,
Squid's out-of-the-tarball access control doesn't come anywhere near
handling our needs, interfacing with our systems, etc).

If the answer is "you'll have to code it yourself", that's fine, but I
wanted to check first. We're still using the Apache 1.3.x source base and do
not plan on tackling the 2.0 stuff for a while (until the proxy and cache
functionality is more solid, etc). My coding strategy for adding the
additional proxy log items will probably make use of the mod_log_config
facility to log "notes" (e.g. "%{proxy-s2}n) from other modules, mod_proxy
in this case, using the ap_table_set(r->notes,"proxy-s2","...") API call.

Is the r->notes approach the best strategy? Should I contribute the code
back to the Apache group, or is logging proxy cache information too esoteric
to be of general use?

Any help, info, insights are welcome.


------_=_NextPart_001_01C1CBAA.07D59040
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>proxy logging code</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hello, I apologize if this issue has =
come up before, but I thought I would run it by the list before =
proceeding with modifying the mod_proxy C code:</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">My organization uses the Apache proxy =
functionality pretty extensively, both reverse and forward. There =
doesn't seem to be any way to log proxy transfer information associated =
with a request to the access logs. We have some Netscape proxies we =
want to retire and quite a bit of cache and throughput performance =
monitoring based on the transfer logs that I can't seem to duplicate =
with Apache. In particular, I need to log the following additional =
request items:</FONT></P>
<UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">. . . s2 c2 b1 b2 h1 h2 h3 h4 dnstm =
route</FONT>
</UL>
<P><FONT SIZE=3D2 FACE=3D"Arial"> </FONT>
<UL>
<P><FONT SIZE=3D2 FACE=3D"Courier New">s2    - remote =
server status response</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">c2    - bytes =
served from remote host</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">b1    - client =
request body size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">b2    - proxy =
request body size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">h1    - client =
request header size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">h2    - proxy =
response to client header size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">h3    - proxy =
request to remote header size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">h4    - remote =
response header size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">dnstm - remote host DNS resolve =
time (ms), or "-" for ProxyRemote forwards</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">route - =
"remoteproxy:port" or "-"</FONT>
</P>
</UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">I believe the standard response to =
this issue is "why don't you just use Squid?", and my =
response to that is that I don't want to unless I have to. We are doing =
a lot of reverse-proxy virtual hosting along with caching, and we like =
Apache just fine. The Apache performance is acceptable, etc. We also =
use quite a bit of mod_perl. In the case of our old existing Netscape =
proxies, I have quite a bit of NSAPI C code (access control system) I =
need to rewrite, and I would prefer to code it using the Apache API. =
(And no, Squid's out-of-the-tarball access control doesn't come =
anywhere near handling our needs, interfacing with our systems, =
etc).</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">If the answer is "you'll have to =
code it yourself", that's fine, but I wanted to check first. We're =
still using the Apache 1.3.x source base and do not plan on tackling =
the 2.0 stuff for a while (until the proxy and cache functionality is =
more solid, etc). My coding strategy for adding the additional proxy =
log items will probably make use of the mod_log_config facility to log =
"notes" (e.g. "%{proxy-s2}n) from other modules, =
mod_proxy in this case, using the =
ap_table_set(r->notes,"proxy-s2","...") API =
call.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Is the r->notes approach the best =
strategy? Should I contribute the code back to the Apache group, or is =
logging proxy cache information too esoteric to be of general =
use?</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Any help, info, insights are =
welcome.</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1CBAA.07D59040--
agfoust [ Do, 14 März 2002 23:46 ] [ ID #11873 ]
Webserver » gmane.comp.apache.mod-proxy » proxy logging code

Vorheriges Thema: httpd-2.0 nightly build log
Nächstes Thema: httpd-2.0 nightly build log