]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Emilio Casbas <ecasbas@unav.es>
authorhno <>
Fri, 18 May 2007 01:55:52 +0000 (01:55 +0000)
committerhno <>
Fri, 18 May 2007 01:55:52 +0000 (01:55 +0000)
logformat %rp logging the URL-Path only (excluding hostname)

we need a "%ru" parameter like the httpd native log, that is showing;
/SI/images/servicios/normasdeuso/normas.swf instead of
http://X.X.X.60/SI/images/servicios/normasdeuso/normas.swf

I have done a small patch to have a new "rp" format code in order to
show only the urlpath in the access log.

src/access_log.cc
src/cf.data.pre

index 8402234f3df3f258b140df6e344eddb662f71313..1e486eafda644d3b31ef1f6bf3697106a97fb40f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.cc,v 1.122 2007/04/28 22:26:37 hno Exp $
+ * $Id: access_log.cc,v 1.123 2007/05/17 19:55:52 hno Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -364,6 +364,7 @@ typedef enum {
 
     LFT_REQUEST_METHOD,
     LFT_REQUEST_URI,
+    LFT_REQUEST_URLPATH,
     /*LFT_REQUEST_QUERY, * // * this is not needed. see strip_query_terms */
     LFT_REQUEST_VERSION,
 
@@ -482,6 +483,7 @@ struct logformat_token_table_entry logformat_token_table[] =
 
         {"rm", LFT_REQUEST_METHOD},
         {"ru", LFT_REQUEST_URI},       /* doesn't include the query-string */
+        {"rp", LFT_REQUEST_URLPATH},   /* doesn't include the host */
         /* { "rq", LFT_REQUEST_QUERY }, * /     / * the query-string, INCLUDING the leading ? */
         {">v", LFT_REQUEST_VERSION},
         {"rv", LFT_REQUEST_VERSION},
@@ -763,6 +765,13 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
 
             break;
 
+        case LFT_REQUEST_URLPATH:
+           if (al->request) {
+               out = al->request->urlpath.buf();
+               quote = 1;
+           }
+            break;
+
         case LFT_REQUEST_VERSION:
             snprintf(tmp, sizeof(tmp), "%d.%d", (int) al->http.version.major, (int) al->http.version.minor);
 
index 7393d0b41344d6f94a826f7f1d41a53ff59780ff..c1a26fb4427e276a80b9d21724584e1df1fcf9bc 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.434 2007/05/13 21:27:50 hno Exp $
+# $Id: cf.data.pre,v 1.435 2007/05/17 19:55:52 hno Exp $
 #
 #
 # SQUID Web Proxy Cache                http://www.squid-cache.org/
@@ -1235,6 +1235,7 @@ DOC_START
                mt      MIME content type
                rm      Request method (GET/POST etc)
                ru      Request URL
+               rp      Request URL-Path excluding hostname
                rv      Request protocol version
                et      Tag returned by external acl
                ea      Log string returned by external acl