From: Amos Jeffries Date: Fri, 28 May 2010 03:59:04 +0000 (+1200) Subject: Bug 2810: common log format generates 2 lines of syslog X-Git-Tag: SQUID_3_2_0_1~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=632e3c27e933ac73bc46704e37c1c678ef30a2e4;p=thirdparty%2Fsquid.git Bug 2810: common log format generates 2 lines of syslog Based on work by Keyran Bayliss --- diff --git a/src/log/access_log.cc b/src/log/access_log.cc index 85afb20709..7f0423aa88 100644 --- a/src/log/access_log.cc +++ b/src/log/access_log.cc @@ -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; } -