From: serassio <> Date: Sat, 30 Sep 2006 22:51:41 +0000 (+0000) Subject: Bug #1784: access_log syslog results in blanks syslog lines between every access... X-Git-Tag: SQUID_3_0_PRE5~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e293bb20eb936e746c1f5dcfd54b79e49256bcf8;p=thirdparty%2Fsquid.git Bug #1784: access_log syslog results in blanks syslog lines between every access log entry. workaround: define a custom log format. Forward port of 2.6 patch. --- diff --git a/src/access_log.cc b/src/access_log.cc index 2cc32c64d2..f69a0e4bcc 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -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