diff -ru squid-2.5.STABLE2/src/access_log.c squid-2.5.STABLE2-extendedlog/src/access_log.c
--- squid-2.5.STABLE2/src/access_log.c	Sun Jun 16 13:25:40 2002
+++ squid-2.5.STABLE2-extendedlog/src/access_log.c	Sun Apr 27 19:21:02 2003
@@ -38,6 +38,7 @@
 
 static void accessLogSquid(AccessLogEntry * al);
 static void accessLogCommon(AccessLogEntry * al);
+static void accessLogExtended(AccessLogEntry * al);
 static Logfile *logfile = NULL;
 #if HEADERS_LOG
 static Logfile *headerslog = NULL;
@@ -287,6 +288,39 @@
     safe_free(user2);
 }
 
+static void
+accessLogExtended(AccessLogEntry * al)
+{
+    const char *client = NULL;
+    char *user1 = NULL, *user2 = 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);
+    user1 = accessLogFormatName(al->cache.authuser);
+    user2 = accessLogFormatName(al->cache.rfc931);
+    logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld \"%s\" \"%s\" %s:%s",
+	client,
+	user2 ? user2 : dash_str,
+	user1 ? user1 : dash_str,
+	mkhttpdlogtime(&squid_curtime),
+	al->private.method_str,
+	al->url,
+	al->http.version.major, al->http.version.minor,
+	al->http.code,
+	(long int) al->cache.size,
+	referer ? referer : dash_str,
+	useragent ? useragent : dash_str,
+	log_tags[al->cache.code],
+	hier_strings[al->hier.code]);
+    safe_free(user1);
+    safe_free(user2);
+}
+
 void
 accessLogLog(AccessLogEntry * al)
 {
@@ -305,6 +339,8 @@
 
     if (Config.onoff.common_log)
 	accessLogCommon(al);
+    else if (Config.onoff.extended_log)
+	accessLogExtended(al);
     else
 	accessLogSquid(al);
     if (Config.onoff.log_mime_hdrs) {
diff -ru squid-2.5.STABLE2/src/cf.data.pre squid-2.5.STABLE2-extendedlog/src/cf.data.pre
--- squid-2.5.STABLE2/src/cf.data.pre	Wed Feb  5 06:27:50 2003
+++ squid-2.5.STABLE2-extendedlog/src/cf.data.pre	Sun Apr 27 18:02:17 2003
@@ -874,6 +874,23 @@
 DOC_END
 
 
+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
 TYPE: onoff
diff -ru squid-2.5.STABLE2/src/client_side.c squid-2.5.STABLE2-extendedlog/src/client_side.c
--- squid-2.5.STABLE2/src/client_side.c	Thu Feb 20 00:39:12 2003
+++ squid-2.5.STABLE2-extendedlog/src/client_side.c	Sun Apr 27 18:02:17 2003
@@ -814,6 +814,7 @@
 	    http->al.http.method = request->method;
 	    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->auth_user_request) {
 		http->al.cache.authuser = xstrdup(authenticateUserRequestUsername(request->auth_user_request));
diff -ru squid-2.5.STABLE2/src/structs.h squid-2.5.STABLE2-extendedlog/src/structs.h
--- squid-2.5.STABLE2/src/structs.h	Tue Jan 21 01:06:39 2003
+++ squid-2.5.STABLE2-extendedlog/src/structs.h	Sun Apr 27 18:02:17 2003
@@ -564,6 +564,7 @@
 	int source_ping;
 #endif
 	int common_log;
+	int extended_log;
 	int log_mime_hdrs;
 	int log_fqdn;
 	int announce;
@@ -1040,6 +1041,7 @@
     struct {
 	char *request;
 	char *reply;
+        HttpHeader *request_hdr;
     } headers;
     struct {
 	const char *method_str;
