]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1784: access_log syslog results in blanks syslog lines between every access...
authorserassio <>
Sat, 30 Sep 2006 22:51:41 +0000 (22:51 +0000)
committerserassio <>
Sat, 30 Sep 2006 22:51:41 +0000 (22:51 +0000)
workaround: define a custom log format.

Forward port of 2.6 patch.

src/access_log.cc

index 2cc32c64d26dbb97d3ef8b4da207ca5db9de3f32..f69a0e4bcc7cf79e694bb28b15cf79802cd9b7a1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.cc,v 1.116 2006/07/26 19:55:19 hno Exp $
+ * $Id: access_log.cc,v 1.117 2006/09/30 16:51:41 serassio Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -1271,34 +1271,47 @@ accessLogSquid(AccessLogEntry * al, Logfile * logfile)
     if (user && !*user)
         safe_free(user);
 
-    logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s",
-                  (int) current_time.tv_sec,
-                  (int) current_time.tv_usec / 1000,
-                  al->cache.msec,
-                  client,
-                  log_tags[al->cache.code],
-                  al->http.code,
-                  (long int) al->cache.size,
-                  al->_private.method_str,
-                  al->url,
-                  user ? user : dash_str,
-                  al->hier.ping.timedout ? "TIMEOUT_" : "",
-                  hier_strings[al->hier.code],
-                  al->hier.host,
-                  al->http.content_type);
-
-    safe_free(user);
-
-    if (Config.onoff.log_mime_hdrs) {
+    if (!Config.onoff.log_mime_hdrs) {
+        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s",
+                      (long int) current_time.tv_sec,
+                      (int) current_time.tv_usec / 1000,
+                      al->cache.msec,
+                      client,
+                      log_tags[al->cache.code],
+                      al->http.code,
+                      (long int) al->cache.size,
+                      al->_private.method_str,
+                      al->url,
+                      user ? user : dash_str,
+                      al->hier.ping.timedout ? "TIMEOUT_" : "",
+                      hier_strings[al->hier.code],
+                      al->hier.host,
+                      al->http.content_type);
+    } else {
         char *ereq = log_quote(al->headers.request);
         char *erep = log_quote(al->headers.reply);
-        logfilePrintf(logfile, " [%s] [%s]\n", ereq, erep);
+        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s [%s] [%s]",
+                      (long int) current_time.tv_sec,
+                      (int) current_time.tv_usec / 1000,
+                      al->cache.msec,
+                      client,
+                      log_tags[al->cache.code],
+                      al->http.code,
+                      (long int) al->cache.size,
+                      al->_private.method_str,
+                      al->url,
+                      user ? user : dash_str,
+                      al->hier.ping.timedout ? "TIMEOUT_" : "",
+                      hier_strings[al->hier.code],
+                      al->hier.host,
+                      al->http.content_type,
+                      ereq,
+                      erep);
         safe_free(ereq);
         safe_free(erep);
-    } else {
-        logfilePrintf(logfile, "\n");
     }
 
+    safe_free(user);
 }
 
 static void