httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Folini <christian.fol...@netnea.com>
Subject [PATCH] Logging the handler in the access log
Date Sun, 31 Jan 2010 20:03:07 GMT
Hello all,

In a heterogenous setup with multiple servers and reverse 
proxies, life can be a burden. At times, the access log could help
by sharing some insight on the handler involved with
the response.

Unfortunately, mod_log_config does not give an easy way to log
this information.

Therefore I am proposing a tiny patch to add this functionality:

Patch against branches/2.2.x
$> svn diff
Index: mod_log_config.c
===================================================================
--- mod_log_config.c    (revision 903198)
+++ mod_log_config.c    (working copy)
@@ -380,6 +380,10 @@
 {
     return pfmt(r->pool, r->status);
 }
+static const char *log_handler(request_rec *r, char *a)
+{
+    return ap_escape_logitem(r->pool, r->handler);
+}

 static const char *clf_log_bytes_sent(request_rec *r, char *a)
 {
@@ -1516,6 +1520,7 @@
         log_pfn_register(p, "T", log_request_duration, 1);
         log_pfn_register(p, "U", log_request_uri, 1);
         log_pfn_register(p, "s", log_status, 1);
+        log_pfn_register(p, "R", log_handler, 1);
     }

     return OK;


So this adds an item named %R to the LogFormat directive.
(-> I'm happy with every alternative letter of course)


I reckon most admins know their handlers quite well. But the real world
is complicated at times, and this tiny enhancement could be helpful
for those in need.

Is there any opinion on this?

Best,

Christian


-- 
When there are too many policemen, there can be no liberty. When there
are too many soldiers, there can be no peace. When there are too many
lawyers, there can be no justice.
-- Lin Yutang

Mime
View raw message