]> git.pld-linux.org Git - packages/squid.git/blob - squid-apache-like-combined-log.patch
- BR: automake
[packages/squid.git] / squid-apache-like-combined-log.patch
1 diff -Nur squid-2.5.STABLE3.orig/src/access_log.c squid-2.5.STABLE3/src/access_log.c
2 --- squid-2.5.STABLE3.orig/src/access_log.c     2003-09-08 16:16:03.000000000 +0200
3 +++ squid-2.5.STABLE3/src/access_log.c  2003-09-08 16:23:16.000000000 +0200
4 @@ -268,12 +268,35 @@
5  {
6      const char *client = NULL;
7      char *user1 = NULL, *user2 = NULL;
8 +
9 +    request_t * request = al->request;
10 +    const HttpHeader *req_hdr = &request->header;
11 +
12 +
13      if (Config.onoff.log_fqdn)
14         client = fqdncache_gethostbyaddr(al->cache.caddr, 0);
15      if (client == NULL)
16         client = inet_ntoa(al->cache.caddr);
17      user1 = accessLogFormatName(al->cache.authuser);
18      user2 = accessLogFormatName(al->cache.rfc931);
19 +
20 +    logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld \"%s\" \"%s\"",
21 +       client,
22 +       user2 ? user2 : dash_str,
23 +       user1 ? user1 : dash_str,
24 +       mkhttpdlogtime(&squid_curtime),
25 +       al->private.method_str,
26 +       al->url,
27 +       al->http.version.major, al->http.version.minor,
28 +       al->http.code,
29 +       (long int) al->cache.size,
30 +       httpHeaderHas( req_hdr, HDR_REFERER ) ?
31 +         httpHeaderGetStr( req_hdr, HDR_REFERER ) :
32 +         dash_str,     // Referer if we have it, else dash_str.
33 +       httpHeaderHas( req_hdr, HDR_USER_AGENT ) ?
34 +         httpHeaderGetStr( req_hdr, HDR_USER_AGENT ) :
35 +         dash_str );   // User-Agent if we have it, else dash_str.
36 +
37      logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld %s:%s",
38         client,
39         user2 ? user2 : dash_str,
40 @@ -286,6 +309,7 @@
41         (long int) al->cache.size,
42         log_tags[al->cache.code],
43         hier_strings[al->hier.code]);
44 +
45      safe_free(user1);
46      safe_free(user2);
47  }
48 diff -Nur squid-2.5.STABLE3.orig/src/client_side.c squid-2.5.STABLE3/src/client_side.c
49 --- squid-2.5.STABLE3.orig/src/client_side.c    2003-09-08 16:16:03.000000000 +0200
50 +++ squid-2.5.STABLE3/src/client_side.c 2003-09-08 16:20:20.000000000 +0200
51 @@ -815,6 +815,9 @@
52             http->al.http.version = request->http_ver;
53             http->al.headers.request = xstrdup(mb.buf);
54             http->al.hier = request->hier;
55 +
56 +           http->al.request = request;
57 +
58             if (request->auth_user_request) {
59                 if (authenticateUserRequestUsername(request->auth_user_request))
60                     http->al.cache.authuser = xstrdup(authenticateUserRequestUsername(request->auth_user_request));
61 diff -Nur squid-2.5.STABLE3.orig/src/structs.h squid-2.5.STABLE3/src/structs.h
62 --- squid-2.5.STABLE3.orig/src/structs.h        2003-09-08 16:16:03.000000000 +0200
63 +++ squid-2.5.STABLE3/src/structs.h     2003-09-08 16:20:20.000000000 +0200
64 @@ -1043,6 +1043,9 @@
65      struct {
66         const char *method_str;
67      } private;
68 +
69 +    request_t * request;
70 +
71      HierarchyLogEntry hier;
72  };
73  
This page took 0.027592 seconds and 3 git commands to generate.