]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2564: logformat '%tl' field not working as advertised
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 12 Jan 2009 13:44:31 +0000 (02:44 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 12 Jan 2009 13:44:31 +0000 (02:44 +1300)
src/access_log.cc

index f6cec335cdcb233372c5c620e0294150a0e9ec94..1fcdd266305a5e4fd79d6af819b5ec5c610c617e 100644 (file)
@@ -597,13 +597,16 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             struct tm *t;
             spec = fmt->data.timespec;
 
-            if (!spec)
-                spec = "%d/%b/%Y:%H:%M:%S";
-
-            if (fmt->type == LFT_TIME_LOCALTIME)
+            if (fmt->type == LFT_TIME_LOCALTIME) {
+                if (!spec)
+                    spec = "%d/%b/%Y:%H:%M:%S %z";
                 t = localtime(&squid_curtime);
-            else
+            } else {
+                if (!spec)
+                    spec = "%d/%b/%Y:%H:%M:%S";
+
                 t = gmtime(&squid_curtime);
+            }
 
             strftime(tmp, sizeof(tmp), spec, t);