]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2810: common log format generates 2 lines of syslog
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 28 May 2010 03:59:04 +0000 (15:59 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 28 May 2010 03:59:04 +0000 (15:59 +1200)
Based on work by Keyran Bayliss

src/log/access_log.cc

index 85afb207091a73905f578b439c196962d6b2a7e9..7f0423aa88210793f456348b3074546fed6b46dc 100644 (file)
@@ -1845,7 +1845,7 @@ accessLogCommon(AccessLogEntry * al, Logfile * logfile)
 
     user2 = accessLogFormatName(al->cache.rfc931);
 
-    logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %"PRId64" %s%s:%s",
+    logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %"PRId64" %s%s:%s%c",
                   client,
                   user2 ? user2 : dash_str,
                   user1 ? user1 : dash_str,
@@ -1857,7 +1857,8 @@ accessLogCommon(AccessLogEntry * al, Logfile * logfile)
                   al->cache.replySize,
                   log_tags[al->cache.code],
                   al->http.statusSfx(),
-                  hier_code_str[al->hier.code]);
+                  hier_code_str[al->hier.code],
+                  (Config.onoff.log_mime_hdrs?"":"\n"));
 
     safe_free(user1);
 
@@ -1869,10 +1870,7 @@ accessLogCommon(AccessLogEntry * al, Logfile * logfile)
         logfilePrintf(logfile, " [%s] [%s]\n", ereq, erep);
         safe_free(ereq);
         safe_free(erep);
-    } else {
-        logfilePrintf(logfile, "\n");
     }
-
 }
 
 #if ICAP_CLIENT
@@ -2468,4 +2466,3 @@ logTypeIsATcpHit(log_type code)
 
     return 0;
 }
-