diff --context=2 -r ../squid-ssl-DIST/src/access_log.c ./src/access_log.c *** ../squid-ssl-DIST/src/access_log.c Thu Jun 22 12:45:22 2000 --- ./src/access_log.c Thu Jun 22 13:46:07 2000 *************** *** 39,42 **** --- 39,43 ---- static void accessLogSquid(AccessLogEntry * al); static void accessLogCommon(AccessLogEntry * al); + static void accessLogExtended(AccessLogEntry * al, MemBuf * mb); static Logfile *logfile = NULL; #if HEADERS_LOG *************** *** 116,119 **** --- 117,153 ---- /* log_quote -- URL-style encoding on MIME headers. */ + + static void + accessLogOpen(const char *fname) + { + assert(fname); + } + + static void + accessLogExtended(AccessLogEntry * al, MemBuf * mb) + { + const char *client = NULL; + const char *referer = NULL; + const char *useragent = NULL; + if (Config.onoff.log_fqdn) + client = fqdncache_gethostbyaddr(al->cache.caddr, 0); + if (client == NULL) + client = inet_ntoa(al->cache.caddr); + useragent = httpHeaderGetStr(al->headers.request_hdr, HDR_USER_AGENT); + referer = httpHeaderGetStr(al->headers.request_hdr, HDR_REFERER); + memBufPrintf(mb, "%s %s - [%s] \"%s %s HTTP/%.1f\" %d %d \"%s\" \"%s\" %s:%s", + client, + al->cache.ident, + mkhttpdlogtime(&squid_curtime), + al->private.method_str, + al->url, + al->http.version, + al->http.code, + al->cache.size, + referer ? referer : "-", + useragent ? useragent : "-", + log_tags[al->cache.code], + hier_strings[al->hier.code]); + } char * diff --context=2 -r ../squid-ssl-DIST/src/cf.data.pre ./src/cf.data.pre *** ../squid-ssl-DIST/src/cf.data.pre Thu Jun 22 12:45:22 2000 --- ./src/cf.data.pre Thu Jun 22 13:45:28 2000 *************** *** 772,775 **** --- 772,792 ---- + NAME: emulate_extended_httpd_log + COMMENT: on|off + TYPE: onoff + DEFAULT: off + LOC: Config.onoff.extended_log + DOC_START + The Cache can emulate the log file format which many 'httpd' + programs use. To disable/enable this emulation, set + emulate_extended_httpd_log to 'off' or 'on'. The default + is to use the native log format since it includes useful + information that Squid-specific log analysers use. The extended + version includes the referer and user-agent fields. + + emulate_extended_httpd_log off + DOC_END + + NAME: emulate_httpd_log COMMENT: on|off diff --context=2 -r ../squid-ssl-DIST/src/client_side.c ./src/client_side.c *** ../squid-ssl-DIST/src/client_side.c Thu Jun 22 12:45:22 2000 --- ./src/client_side.c Thu Jun 22 13:45:28 2000 *************** *** 726,729 **** --- 726,730 ---- http->al.http.version = request->http_ver; http->al.headers.request = xstrdup(mb.buf); + http->al.headers.request_hdr = &request->header; http->al.hier = request->hier; if (request->user_ident[0]) diff --context=2 -r ../squid-ssl-DIST/src/structs.h ./src/structs.h *** ../squid-ssl-DIST/src/structs.h Thu Jun 22 12:45:22 2000 --- ./src/structs.h Thu Jun 22 13:45:28 2000 *************** *** 399,402 **** --- 399,403 ---- #endif int common_log; + int extended_log; int log_mime_hdrs; int log_fqdn; *************** *** 856,859 **** --- 857,861 ---- char *request; char *reply; + HttpHeader *request_hdr; } headers; struct {