]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: don't report logformat errors in backends
authorWilly Tarreau <w@1wt.eu>
Thu, 31 May 2012 17:39:23 +0000 (19:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 May 2012 17:39:23 +0000 (19:39 +0200)
Logs have always been ignored by backends, do not report useless warnings there.

src/cfgparse.c

index a45acb15d13d96c3dcb5b8014712c325238d6345..fe398940146b18a1e2df80a45ec15cf0fda29fc8 100644 (file)
@@ -1539,6 +1539,14 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        curproxy->monitor_uri_len = defproxy.monitor_uri_len;
                        if (defproxy.defbe.name)
                                curproxy->defbe.name = strdup(defproxy.defbe.name);
+
+                       /* get either a pointer to the logformat string or a copy of it */
+                       curproxy->logformat_string = defproxy.logformat_string;
+                       if (curproxy->logformat_string &&
+                           curproxy->logformat_string != default_http_log_format &&
+                           curproxy->logformat_string != default_tcp_log_format &&
+                           curproxy->logformat_string != clf_http_log_format)
+                               curproxy->logformat_string = strdup(curproxy->logformat_string);
                }
 
                if (curproxy->cap & PR_CAP_BE) {
@@ -1563,14 +1571,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        LIST_ADDQ(&curproxy->logsrvs, &node->list);
                }
 
-               /* get either a pointer to the logformat string or a copy of it */
-               curproxy->logformat_string = defproxy.logformat_string;
-               if (curproxy->logformat_string &&
-                   curproxy->logformat_string != default_http_log_format &&
-                   curproxy->logformat_string != default_tcp_log_format &&
-                   curproxy->logformat_string != clf_http_log_format)
-                       curproxy->logformat_string = strdup(curproxy->logformat_string);
-
                curproxy->uniqueid_format_string = defproxy.uniqueid_format_string;
                if (curproxy->uniqueid_format_string)
                        curproxy->uniqueid_format_string = strdup(curproxy->uniqueid_format_string);
@@ -6223,6 +6223,14 @@ out_uri_auth_compat:
                }
 
                /* compile the log format */
+               if (!(curproxy->cap & PR_CAP_FE)) {
+                       if (curproxy->logformat_string != default_http_log_format &&
+                           curproxy->logformat_string != default_tcp_log_format &&
+                           curproxy->logformat_string != clf_http_log_format)
+                               free(curproxy->logformat_string);
+                       curproxy->logformat_string = NULL;
+               }
+
                if (curproxy->logformat_string)
                        parse_logformat_string(curproxy->logformat_string, curproxy, &curproxy->logformat, curproxy->mode);