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);
+ curproxy->conf.logformat_string = defproxy.conf.logformat_string;
+ if (curproxy->conf.logformat_string &&
+ curproxy->conf.logformat_string != default_http_log_format &&
+ curproxy->conf.logformat_string != default_tcp_log_format &&
+ curproxy->conf.logformat_string != clf_http_log_format)
+ curproxy->conf.logformat_string = strdup(curproxy->conf.logformat_string);
+
+ if (defproxy.conf.lfs_file) {
+ curproxy->conf.lfs_file = strdup(defproxy.conf.lfs_file);
+ curproxy->conf.lfs_line = defproxy.conf.lfs_line;
+ }
}
if (curproxy->cap & PR_CAP_BE) {
LIST_ADDQ(&curproxy->logsrvs, &node->list);
}
- curproxy->uniqueid_format_string = defproxy.uniqueid_format_string;
- if (curproxy->uniqueid_format_string)
- curproxy->uniqueid_format_string = strdup(curproxy->uniqueid_format_string);
+ curproxy->conf.uniqueid_format_string = defproxy.conf.uniqueid_format_string;
+ if (curproxy->conf.uniqueid_format_string)
+ curproxy->conf.uniqueid_format_string = strdup(curproxy->conf.uniqueid_format_string);
+
+ if (defproxy.conf.uif_file) {
+ curproxy->conf.uif_file = strdup(defproxy.conf.uif_file);
+ curproxy->conf.uif_line = defproxy.conf.uif_line;
+ }
/* copy default header unique id */
if (defproxy.header_unique_id)
free(defproxy.expect_str);
if (defproxy.expect_regex) regfree(defproxy.expect_regex);
- if (defproxy.logformat_string != default_http_log_format &&
- defproxy.logformat_string != default_tcp_log_format &&
- defproxy.logformat_string != clf_http_log_format)
- free(defproxy.logformat_string);
+ if (defproxy.conf.logformat_string != default_http_log_format &&
+ defproxy.conf.logformat_string != default_tcp_log_format &&
+ defproxy.conf.logformat_string != clf_http_log_format)
+ free(defproxy.conf.logformat_string);
- free(defproxy.uniqueid_format_string);
+ free(defproxy.conf.uniqueid_format_string);
+ free(defproxy.conf.lfs_file);
+ free(defproxy.conf.uif_file);
for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
chunk_destroy(&defproxy.errmsg[rc]);
goto out;
}
}
- 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 = logformat;
+ if (curproxy->conf.logformat_string != default_http_log_format &&
+ curproxy->conf.logformat_string != default_tcp_log_format &&
+ curproxy->conf.logformat_string != clf_http_log_format)
+ free(curproxy->conf.logformat_string);
+ curproxy->conf.logformat_string = logformat;
+
+ free(curproxy->conf.lfs_file);
+ curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
+ curproxy->conf.lfs_line = curproxy->conf.args.line;
}
else if (!strcmp(args[1], "tcplog")) {
/* generate a detailed TCP log */
- 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 = default_tcp_log_format;
+ if (curproxy->conf.logformat_string != default_http_log_format &&
+ curproxy->conf.logformat_string != default_tcp_log_format &&
+ curproxy->conf.logformat_string != clf_http_log_format)
+ free(curproxy->conf.logformat_string);
+ curproxy->conf.logformat_string = default_tcp_log_format;
+
+ free(curproxy->conf.lfs_file);
+ curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
+ curproxy->conf.lfs_line = curproxy->conf.args.line;
}
else if (!strcmp(args[1], "tcpka")) {
/* enable TCP keep-alives on client and server sessions */
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- free(curproxy->uniqueid_format_string);
- curproxy->uniqueid_format_string = strdup(args[1]);
+ free(curproxy->conf.uniqueid_format_string);
+ curproxy->conf.uniqueid_format_string = strdup(args[1]);
- /* get a chance to improve log-format error reporting by
- * reporting the correct line-number when possible.
- */
- if (curproxy != &defproxy) {
- curproxy->conf.args.ctx = ARGC_UIF;
- if (curproxy->uniqueid_format_string)
- parse_logformat_string(curproxy->uniqueid_format_string, curproxy, &curproxy->format_unique_id, 0,
- (proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR);
- free(curproxy->uniqueid_format_string);
- curproxy->uniqueid_format_string = NULL;
- }
+ free(curproxy->conf.uif_file);
+ curproxy->conf.uif_file = strdup(curproxy->conf.args.file);
+ curproxy->conf.uif_line = curproxy->conf.args.line;
}
else if (strcmp(args[0], "unique-id-header") == 0) {
goto out;
}
- 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 = strdup(args[1]);
+ if (curproxy->conf.logformat_string != default_http_log_format &&
+ curproxy->conf.logformat_string != default_tcp_log_format &&
+ curproxy->conf.logformat_string != clf_http_log_format)
+ free(curproxy->conf.logformat_string);
+ curproxy->conf.logformat_string = strdup(args[1]);
+
+ free(curproxy->conf.lfs_file);
+ curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
+ curproxy->conf.lfs_line = curproxy->conf.args.line;
/* get a chance to improve log-format error reporting by
* reporting the correct line-number when possible.
file, linenum, curproxy->id);
err_code |= ERR_WARN;
}
- else if (curproxy->cap & PR_CAP_FE) {
- curproxy->conf.args.ctx = ARGC_LOG;
- if (curproxy->logformat_string)
- parse_logformat_string(curproxy->logformat_string, curproxy, &curproxy->logformat, LOG_OPT_MANDATORY,
- SMP_VAL_FE_LOG_END);
- free(curproxy->logformat_string);
- curproxy->logformat_string = NULL;
- }
}
else if (!strcmp(args[0], "log") && kwm == KWM_NO) {
/* 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->conf.logformat_string != default_http_log_format &&
+ curproxy->conf.logformat_string != default_tcp_log_format &&
+ curproxy->conf.logformat_string != clf_http_log_format)
+ free(curproxy->conf.logformat_string);
+ curproxy->conf.logformat_string = NULL;
+ free(curproxy->conf.lfs_file);
+ curproxy->conf.lfs_file = NULL;
+ curproxy->conf.lfs_line = 0;
}
- curproxy->conf.args.ctx = ARGC_LOG;
- if (curproxy->logformat_string)
- parse_logformat_string(curproxy->logformat_string, curproxy, &curproxy->logformat, LOG_OPT_MANDATORY,
+ if (curproxy->conf.logformat_string) {
+ curproxy->conf.args.ctx = ARGC_LOG;
+ curproxy->conf.args.file = curproxy->conf.lfs_file;
+ curproxy->conf.args.line = curproxy->conf.lfs_line;
+ parse_logformat_string(curproxy->conf.logformat_string, curproxy, &curproxy->logformat, LOG_OPT_MANDATORY,
SMP_VAL_FE_LOG_END);
+ curproxy->conf.args.file = NULL;
+ curproxy->conf.args.line = 0;
+ }
- curproxy->conf.args.ctx = ARGC_UIF;
- if (curproxy->uniqueid_format_string)
- parse_logformat_string(curproxy->uniqueid_format_string, curproxy, &curproxy->format_unique_id, 0,
+ if (curproxy->conf.uniqueid_format_string) {
+ curproxy->conf.args.ctx = ARGC_UIF;
+ curproxy->conf.args.file = curproxy->conf.uif_file;
+ curproxy->conf.args.line = curproxy->conf.uif_line;
+ parse_logformat_string(curproxy->conf.uniqueid_format_string, curproxy, &curproxy->format_unique_id, 0,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR);
+ curproxy->conf.args.file = NULL;
+ curproxy->conf.args.line = 0;
+ }
/* only now we can check if some args remain unresolved */
cfgerr += smp_resolve_args(curproxy);