--------------------- PatchSet 11580 Date: 2007/08/22 00:03:39 Author: hno Branch: SQUID_2_6 Tag: (none) Log: Fix access_log directive parser to parse the documented format the older format is still accepted as well Members: src/cf.data.pre:1.382.2.9->1.382.2.10 src/logfile.c:1.20->1.20.2.1 Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid/squid/src/cf.data.pre,v retrieving revision 1.382.2.9 retrieving revision 1.382.2.10 diff -u -r1.382.2.9 -r1.382.2.10 --- squid/src/cf.data.pre 21 Aug 2007 23:43:35 -0000 1.382.2.9 +++ squid/src/cf.data.pre 22 Aug 2007 00:03:39 -0000 1.382.2.10 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.382.2.9 2007/08/21 23:43:35 hno Exp $ +# $Id: cf.data.pre,v 1.382.2.10 2007/08/22 00:03:39 hno Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -1191,10 +1191,13 @@ access_log syslog[:facility.priority] [format [acl1 [acl2 ....]]] where facility could be any of: - authpriv, daemon, local9 .. local7 or user. + authpriv, daemon, local0 .. local7 or user. And priority could be any of: err, warning, notice, info, debug. + + Note: 2.6.STABLE14 and earlier only supports a slightly different + and undocumented format with all uppercase LOG_FACILITY|LOG_PRIORITY NOCOMMENT_START access_log @DEFAULT_ACCESS_LOG@ squid NOCOMMENT_END Index: squid/src/logfile.c =================================================================== RCS file: /cvsroot/squid/squid/src/logfile.c,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -r1.20 -r1.20.2.1 --- squid/src/logfile.c 2 Sep 2006 14:08:42 -0000 1.20 +++ squid/src/logfile.c 22 Aug 2007 00:03:39 -0000 1.20.2.1 @@ -1,5 +1,5 @@ /* - * $Id: logfile.c,v 1.20 2006/09/02 14:08:42 hno Exp $ + * $Id: logfile.c,v 1.20.2.1 2007/08/22 00:03:39 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -107,7 +107,7 @@ syslog_symbol_t *p; for (p = symbols; p->name != NULL; ++p) - if (!strcmp(s, p->name) || !strcmp(s, p->name + 4)) + if (!strcmp(s, p->name) || !strcasecmp(s, p->name + 4)) return p->value; return 0; } @@ -126,7 +126,10 @@ lf->fd = -1; if (path[6] != '\0') { const char *priority = path + 7; - char *facility = (char *) strchr(priority, '|'); + char *facility = (char *) strchr(priority, '.'); + if (!facility) + facility = (char *) strchr(priority, '|'); + if (facility) { *facility++ = '\0'; lf->syslog_priority |= syslog_ntoa(facility);