diff -ur squid-2.4.STABLE2/src/access_log.c squid-2.4.STABLE2-elf/src/access_log.c
--- squid-2.4.STABLE2/src/access_log.c	Fri Jan 12 01:51:44 2001
+++ squid-2.4.STABLE2-elf/src/access_log.c	Tue Sep 11 22:27:58 2001
@@ -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;
@@ -228,6 +229,33 @@
 	hier_strings[al->hier.code]);
 }
 
+static void
+accessLogExtended(AccessLogEntry * al)
+{
+    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);
+    logfilePrintf(logfile, "%s %s - [%s] \"%s %s HTTP/%d.%d\" %d %d \"%s\" \"%s\" %s:%s",
+	client,
+	al->cache.ident,
+	mkhttpdlogtime(&squid_curtime),
+	al->private.method_str,
+	al->url,
+	al->http.version.major, al->http.version.minor,
+	al->http.code,
+	al->cache.size,
+	referer ? referer : "-",
+	useragent ? useragent : "-",
+	log_tags[al->cache.code],
+	hier_strings[al->hier.code]);
+}
+
 void
 accessLogLog(AccessLogEntry * al)
 {
@@ -254,6 +282,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 -ur squid-2.4.STABLE2/src/cf.data.pre squid-2.4.STABLE2-elf/src/cf.data.pre
--- squid-2.4.STABLE2/src/cf.data.pre	Wed Apr  4 09:01:12 2001
+++ squid-2.4.STABLE2-elf/src/cf.data.pre	Tue Sep 11 19:50:50 2001
@@ -809,6 +809,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 -ur squid-2.4.STABLE2/src/client_side.c squid-2.4.STABLE2-elf/src/client_side.c
--- squid-2.4.STABLE2/src/client_side.c	Sat Apr 21 01:21:41 2001
+++ squid-2.4.STABLE2-elf/src/client_side.c	Tue Sep 11 20:14:25 2001
@@ -237,7 +237,7 @@
 	 * NOTE: get page_id here, based on AclMatchedName because
 	 * if USE_DELAY_POOLS is enabled, then AclMatchedName gets
 	 * clobbered in the clientCreateStoreEntry() call
-	 * just below.  Pedro Ribeiro <pribeiro@isel.pt>
+	 * just below.	Pedro Ribeiro <pribeiro@isel.pt>
 	 */
 	page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName);
 	http->log_type = LOG_TCP_DENIED;
@@ -350,7 +350,7 @@
     /*
      * check if we are allowed to contact other servers
      * @?@: Instead of a 504 (Gateway Timeout) reply, we may want to return 
-     *      a stale entry *if* it matches client requirements
+     *	    a stale entry *if* it matches client requirements
      */
     if (clientOnlyIfCached(http)) {
 	clientProcessOnlyIfCachedMiss(http);
@@ -496,7 +496,7 @@
 	/* Don't memcpy() the whole reply structure here.  For example,
 	 * www.thegist.com (Netscape/1.13) returns a content-length for
 	 * 304's which seems to be the length of the 304 HEADERS!!! and
-	 * not the body they refer to.  */
+	 * not the body they refer to.	*/
 	httpReplyUpdateOnNotModified(oldentry->mem_obj->reply, mem->reply);
 	storeTimestampsSet(oldentry);
 	storeUnregister(http->sc, entry, http);
@@ -738,6 +738,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->user_ident[0])
 		http->al.cache.ident = request->user_ident;
diff -ur squid-2.4.STABLE2/src/structs.h squid-2.4.STABLE2-elf/src/structs.h
--- squid-2.4.STABLE2/src/structs.h	Wed Apr  4 09:01:12 2001
+++ squid-2.4.STABLE2-elf/src/structs.h	Tue Sep 11 20:14:13 2001
@@ -407,6 +407,7 @@
 	int source_ping;
 #endif
 	int common_log;
+	int extended_log;
 	int log_mime_hdrs;
 	int log_fqdn;
 	int announce;
@@ -580,7 +581,7 @@
 /* ETag support is rudimantal;
  * this struct is likely to change
  * Note: "str" points to memory in HttpHeaderEntry (for now)
- *       so ETags should be used as tmp variables only (for now) */
+ *	 so ETags should be used as tmp variables only (for now) */
 struct _ETag {
     const char *str;		/* quoted-string */
     int weak;			/* true if it is a weak validator */
@@ -862,6 +863,7 @@
     struct {
 	char *request;
 	char *reply;
+        HttpHeader *request_hdr;
     } headers;
     struct {
 	const char *method_str;
