DOC: cfgparse: Warn on option (tcp|http)log in backend
The option does not seem to have any effect since at least haproxy
1.3. Also the `log-format` directive already warns when being used
in a backend.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 17b1dd0..40facd5 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -4827,6 +4827,12 @@
free(curproxy->conf.lfs_file);
curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
curproxy->conf.lfs_line = curproxy->conf.args.line;
+
+ if (curproxy != &defproxy && !(curproxy->cap & PR_CAP_FE)) {
+ ha_warning("parsing [%s:%d] : backend '%s' : 'option httplog' directive is ignored in backends.\n",
+ file, linenum, curproxy->id);
+ err_code |= ERR_WARN;
+ }
}
else if (!strcmp(args[1], "tcplog")) {
if (curproxy->conf.logformat_string && curproxy == &defproxy) {
@@ -4854,6 +4860,12 @@
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
+
+ if (curproxy != &defproxy && !(curproxy->cap & PR_CAP_FE)) {
+ ha_warning("parsing [%s:%d] : backend '%s' : 'option tcplog' directive is ignored in backends.\n",
+ file, linenum, curproxy->id);
+ err_code |= ERR_WARN;
+ }
}
else if (!strcmp(args[1], "tcpka")) {
/* enable TCP keep-alives on client and server streams */