Skip to content

Commit e751eeb

Browse files
committed
MEDIUM: proxy/log: leverage lf_expr API for logformat preparsing
Currently, the way proxy-oriented logformat directives are handled is way too complicated. Indeed, "log-format", "log-format-error", "log-format-sd" and "unique-id-format" all rely on preparsing hints stored inside proxy->conf member struct. Those preparsing hints include the original string that should be compiled once the proxy parameters are known plus the config file and line number where the string was found to generate precise error messages in case of failure during the compiling process that happens within check_config_validity(). Now that lf_expr API permits to compile a lf_expr struct that was previously prepared (with original string and config hints), let's leverage lf_expr_compile() from check_config_validity() and instead of relying on individual proxy->conf hints for each logformat expression, store string and config hints in the lf_expr struct directly and use lf_expr helpers funcs to handle them when relevant (ie: original logformat string freeing is now done at a central place inside lf_expr_deinit(), which allows for some simplifications) Doing so allows us to greatly simplify the preparsing logic for those 4 proxy directives, and to finally save some space in the proxy struct. Also, since httpclient proxy has its "logformat" automatically compiled in check_config_validity(), we now use the file hint from the logformat expression struct to set an explicit name that will be reported in case of error ("parsing [httpclient:0] : ...") and remove the extraneous check in httpclient_precheck() (logformat was parsed twice previously..)
1 parent 2b79457 commit e751eeb

7 files changed

Lines changed: 147 additions & 254 deletions

File tree

include/haproxy/proxy-t.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,6 @@ struct proxy {
427427
struct arg_list args; /* sample arg list that need to be resolved */
428428
unsigned int refcount; /* refcount on this proxy (only used for default proxy for now) */
429429
struct ebpt_node by_name; /* proxies are stored sorted by name here */
430-
char *logformat_string; /* log format string */
431-
char *lfs_file; /* file name where the logformat string appears (strdup) */
432-
int lfs_line; /* file name where the logformat string appears */
433-
int uif_line; /* file name where the unique-id-format string appears */
434-
char *uif_file; /* file name where the unique-id-format string appears (strdup) */
435-
char *uniqueid_format_string; /* unique-id format string */
436-
char *logformat_sd_string; /* log format string for the RFC5424 structured-data part */
437-
char *lfsd_file; /* file name where the structured-data logformat string for RFC5424 appears (strdup) */
438-
int lfsd_line; /* file name where the structured-data logformat string for RFC5424 appears */
439-
char *error_logformat_string;
440-
char *elfs_file;
441-
int elfs_line;
442430
struct list lf_checks; /* list of logformats found in the proxy section that needs to be checked during postparse */
443431
} conf; /* config information */
444432
struct http_ext *http_ext; /* http ext options */

src/cfgparse-listen.c

Lines changed: 53 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,33 +2096,27 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
20962096
if (alertif_too_many_args_idx(1, 1, file, linenum, args, &err_code))
20972097
goto out;
20982098
}
2099-
if (curproxy->conf.logformat_string && curproxy->cap & PR_CAP_DEF) {
2099+
if (curproxy->logformat.str && curproxy->cap & PR_CAP_DEF) {
21002100
char *oldlogformat = "log-format";
21012101
char *clflogformat = "";
21022102

2103-
if (curproxy->conf.logformat_string == default_http_log_format)
2103+
if (curproxy->logformat.str == default_http_log_format)
21042104
oldlogformat = "option httplog";
2105-
else if (curproxy->conf.logformat_string == default_tcp_log_format)
2105+
else if (curproxy->logformat.str == default_tcp_log_format)
21062106
oldlogformat = "option tcplog";
2107-
else if (curproxy->conf.logformat_string == clf_http_log_format)
2107+
else if (curproxy->logformat.str == clf_http_log_format)
21082108
oldlogformat = "option httplog clf";
2109-
else if (curproxy->conf.logformat_string == default_https_log_format)
2109+
else if (curproxy->logformat.str == default_https_log_format)
21102110
oldlogformat = "option httpslog";
21112111
if (logformat == clf_http_log_format)
21122112
clflogformat = " clf";
21132113
ha_warning("parsing [%s:%d]: 'option httplog%s' overrides previous '%s' in 'defaults' section.\n",
21142114
file, linenum, clflogformat, oldlogformat);
21152115
}
2116-
if (curproxy->conf.logformat_string != default_http_log_format &&
2117-
curproxy->conf.logformat_string != default_tcp_log_format &&
2118-
curproxy->conf.logformat_string != clf_http_log_format &&
2119-
curproxy->conf.logformat_string != default_https_log_format)
2120-
free(curproxy->conf.logformat_string);
2121-
curproxy->conf.logformat_string = logformat;
2122-
2123-
free(curproxy->conf.lfs_file);
2124-
curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
2125-
curproxy->conf.lfs_line = curproxy->conf.args.line;
2116+
lf_expr_deinit(&curproxy->logformat);
2117+
curproxy->logformat.str = logformat;
2118+
curproxy->logformat.conf.file = strdup(curproxy->conf.args.file);
2119+
curproxy->logformat.conf.line = curproxy->conf.args.line;
21262120

21272121
if (!(curproxy->cap & PR_CAP_DEF) && !(curproxy->cap & PR_CAP_FE)) {
21282122
ha_warning("parsing [%s:%d] : backend '%s' : 'option httplog' directive is ignored in backends.\n",
@@ -2131,31 +2125,25 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
21312125
}
21322126
}
21332127
else if (strcmp(args[1], "tcplog") == 0) {
2134-
if (curproxy->conf.logformat_string && curproxy->cap & PR_CAP_DEF) {
2128+
if (curproxy->logformat.str && curproxy->cap & PR_CAP_DEF) {
21352129
char *oldlogformat = "log-format";
21362130

2137-
if (curproxy->conf.logformat_string == default_http_log_format)
2131+
if (curproxy->logformat.str == default_http_log_format)
21382132
oldlogformat = "option httplog";
2139-
else if (curproxy->conf.logformat_string == default_tcp_log_format)
2133+
else if (curproxy->logformat.str == default_tcp_log_format)
21402134
oldlogformat = "option tcplog";
2141-
else if (curproxy->conf.logformat_string == clf_http_log_format)
2135+
else if (curproxy->logformat.str == clf_http_log_format)
21422136
oldlogformat = "option httplog clf";
2143-
else if (curproxy->conf.logformat_string == default_https_log_format)
2137+
else if (curproxy->logformat.str == default_https_log_format)
21442138
oldlogformat = "option httpslog";
21452139
ha_warning("parsing [%s:%d]: 'option tcplog' overrides previous '%s' in 'defaults' section.\n",
21462140
file, linenum, oldlogformat);
21472141
}
21482142
/* generate a detailed TCP log */
2149-
if (curproxy->conf.logformat_string != default_http_log_format &&
2150-
curproxy->conf.logformat_string != default_tcp_log_format &&
2151-
curproxy->conf.logformat_string != clf_http_log_format &&
2152-
curproxy->conf.logformat_string != default_https_log_format)
2153-
free(curproxy->conf.logformat_string);
2154-
curproxy->conf.logformat_string = default_tcp_log_format;
2155-
2156-
free(curproxy->conf.lfs_file);
2157-
curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
2158-
curproxy->conf.lfs_line = curproxy->conf.args.line;
2143+
lf_expr_deinit(&curproxy->logformat);
2144+
curproxy->logformat.str = default_tcp_log_format;
2145+
curproxy->logformat.conf.file = strdup(curproxy->conf.args.file);
2146+
curproxy->logformat.conf.line = curproxy->conf.args.line;
21592147

21602148
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
21612149
goto out;
@@ -2170,30 +2158,24 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
21702158
char *logformat;
21712159
/* generate a complete HTTP log */
21722160
logformat = default_https_log_format;
2173-
if (curproxy->conf.logformat_string && curproxy->cap & PR_CAP_DEF) {
2161+
if (curproxy->logformat.str && curproxy->cap & PR_CAP_DEF) {
21742162
char *oldlogformat = "log-format";
21752163

2176-
if (curproxy->conf.logformat_string == default_http_log_format)
2164+
if (curproxy->logformat.str == default_http_log_format)
21772165
oldlogformat = "option httplog";
2178-
else if (curproxy->conf.logformat_string == default_tcp_log_format)
2166+
else if (curproxy->logformat.str == default_tcp_log_format)
21792167
oldlogformat = "option tcplog";
2180-
else if (curproxy->conf.logformat_string == clf_http_log_format)
2168+
else if (curproxy->logformat.str == clf_http_log_format)
21812169
oldlogformat = "option httplog clf";
2182-
else if (curproxy->conf.logformat_string == default_https_log_format)
2170+
else if (curproxy->logformat.str == default_https_log_format)
21832171
oldlogformat = "option httpslog";
21842172
ha_warning("parsing [%s:%d]: 'option httplog' overrides previous '%s' in 'defaults' section.\n",
21852173
file, linenum, oldlogformat);
21862174
}
2187-
if (curproxy->conf.logformat_string != default_http_log_format &&
2188-
curproxy->conf.logformat_string != default_tcp_log_format &&
2189-
curproxy->conf.logformat_string != clf_http_log_format &&
2190-
curproxy->conf.logformat_string != default_https_log_format)
2191-
free(curproxy->conf.logformat_string);
2192-
curproxy->conf.logformat_string = logformat;
2193-
2194-
free(curproxy->conf.lfs_file);
2195-
curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
2196-
curproxy->conf.lfs_line = curproxy->conf.args.line;
2175+
lf_expr_deinit(&curproxy->logformat);
2176+
curproxy->logformat.str = logformat;
2177+
curproxy->logformat.conf.file = strdup(curproxy->conf.args.file);
2178+
curproxy->logformat.conf.line = curproxy->conf.args.line;
21972179

21982180
if (!(curproxy->cap & PR_CAP_DEF) && !(curproxy->cap & PR_CAP_FE)) {
21992181
ha_warning("parsing [%s:%d] : backend '%s' : 'option httpslog' directive is ignored in backends.\n",
@@ -2591,14 +2573,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
25912573
err_code |= ERR_ALERT | ERR_FATAL;
25922574
goto out;
25932575
}
2594-
free(curproxy->conf.uniqueid_format_string);
2595-
curproxy->conf.uniqueid_format_string = strdup(args[1]);
2596-
if (!curproxy->conf.uniqueid_format_string)
2576+
lf_expr_deinit(&curproxy->format_unique_id);
2577+
curproxy->format_unique_id.str = strdup(args[1]);
2578+
if (!curproxy->format_unique_id.str)
25972579
goto alloc_error;
2598-
2599-
free(curproxy->conf.uif_file);
2600-
curproxy->conf.uif_file = strdup(curproxy->conf.args.file);
2601-
curproxy->conf.uif_line = curproxy->conf.args.line;
2580+
curproxy->format_unique_id.conf.file = strdup(curproxy->conf.args.file);
2581+
curproxy->format_unique_id.conf.line = curproxy->conf.args.line;
26022582
}
26032583

26042584
else if (strcmp(args[0], "unique-id-header") == 0) {
@@ -2630,32 +2610,26 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
26302610
err_code |= ERR_ALERT | ERR_FATAL;
26312611
goto out;
26322612
}
2633-
if (curproxy->conf.logformat_string && curproxy->cap & PR_CAP_DEF) {
2613+
if (curproxy->logformat.str && curproxy->cap & PR_CAP_DEF) {
26342614
char *oldlogformat = "log-format";
26352615

2636-
if (curproxy->conf.logformat_string == default_http_log_format)
2616+
if (curproxy->logformat.str == default_http_log_format)
26372617
oldlogformat = "option httplog";
2638-
else if (curproxy->conf.logformat_string == default_tcp_log_format)
2618+
else if (curproxy->logformat.str == default_tcp_log_format)
26392619
oldlogformat = "option tcplog";
2640-
else if (curproxy->conf.logformat_string == clf_http_log_format)
2620+
else if (curproxy->logformat.str == clf_http_log_format)
26412621
oldlogformat = "option httplog clf";
2642-
else if (curproxy->conf.logformat_string == default_https_log_format)
2622+
else if (curproxy->logformat.str == default_https_log_format)
26432623
oldlogformat = "option httpslog";
26442624
ha_warning("parsing [%s:%d]: 'log-format' overrides previous '%s' in 'defaults' section.\n",
26452625
file, linenum, oldlogformat);
26462626
}
2647-
if (curproxy->conf.logformat_string != default_http_log_format &&
2648-
curproxy->conf.logformat_string != default_tcp_log_format &&
2649-
curproxy->conf.logformat_string != clf_http_log_format &&
2650-
curproxy->conf.logformat_string != default_https_log_format)
2651-
free(curproxy->conf.logformat_string);
2652-
curproxy->conf.logformat_string = strdup(args[1]);
2653-
if (!curproxy->conf.logformat_string)
2627+
lf_expr_deinit(&curproxy->logformat);
2628+
curproxy->logformat.str = strdup(args[1]);
2629+
if (!curproxy->logformat.str)
26542630
goto alloc_error;
2655-
2656-
free(curproxy->conf.lfs_file);
2657-
curproxy->conf.lfs_file = strdup(curproxy->conf.args.file);
2658-
curproxy->conf.lfs_line = curproxy->conf.args.line;
2631+
curproxy->logformat.conf.file = strdup(curproxy->conf.args.file);
2632+
curproxy->logformat.conf.line = curproxy->conf.args.line;
26592633

26602634
/* get a chance to improve log-format error reporting by
26612635
* reporting the correct line-number when possible.
@@ -2678,15 +2652,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
26782652
goto out;
26792653
}
26802654

2681-
if (curproxy->conf.logformat_sd_string != default_rfc5424_sd_log_format)
2682-
free(curproxy->conf.logformat_sd_string);
2683-
curproxy->conf.logformat_sd_string = strdup(args[1]);
2684-
if (!curproxy->conf.logformat_sd_string)
2655+
lf_expr_deinit(&curproxy->logformat_sd);
2656+
curproxy->logformat_sd.str = strdup(args[1]);
2657+
if (!curproxy->logformat_sd.str)
26852658
goto alloc_error;
2686-
2687-
free(curproxy->conf.lfsd_file);
2688-
curproxy->conf.lfsd_file = strdup(curproxy->conf.args.file);
2689-
curproxy->conf.lfsd_line = curproxy->conf.args.line;
2659+
curproxy->logformat_sd.conf.file = strdup(curproxy->conf.args.file);
2660+
curproxy->logformat_sd.conf.line = curproxy->conf.args.line;
26902661

26912662
/* get a chance to improve log-format-sd error reporting by
26922663
* reporting the correct line-number when possible.
@@ -2708,18 +2679,17 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
27082679
err_code |= ERR_ALERT | ERR_FATAL;
27092680
goto out;
27102681
}
2711-
if (curproxy->conf.error_logformat_string && curproxy->cap & PR_CAP_DEF) {
2682+
if (curproxy->logformat_error.str && curproxy->cap & PR_CAP_DEF) {
27122683
ha_warning("parsing [%s:%d]: 'error-log-format' overrides previous 'error-log-format' in 'defaults' section.\n",
27132684
file, linenum);
27142685
}
2715-
free(curproxy->conf.error_logformat_string);
2716-
curproxy->conf.error_logformat_string = strdup(args[1]);
2717-
if (!curproxy->conf.error_logformat_string)
2686+
lf_expr_deinit(&curproxy->logformat_error);
2687+
curproxy->logformat_error.str = strdup(args[1]);
2688+
if (!curproxy->logformat_error.str)
27182689
goto alloc_error;
27192690

2720-
free(curproxy->conf.elfs_file);
2721-
curproxy->conf.elfs_file = strdup(curproxy->conf.args.file);
2722-
curproxy->conf.elfs_line = curproxy->conf.args.line;
2691+
curproxy->logformat_error.conf.file = strdup(curproxy->conf.args.file);
2692+
curproxy->logformat_error.conf.line = curproxy->conf.args.line;;
27232693

27242694
/* get a chance to improve log-format error reporting by
27252695
* reporting the correct line-number when possible.

src/cfgparse.c

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,102 +3382,91 @@ int check_config_validity()
33823382
/* check whether we have a logger that uses RFC5424 log format */
33833383
list_for_each_entry(tmplogger, &curproxy->loggers, list) {
33843384
if (tmplogger->format == LOG_FORMAT_RFC5424) {
3385-
if (!curproxy->conf.logformat_sd_string) {
3385+
if (!curproxy->logformat_sd.str) {
33863386
/* set the default logformat_sd_string */
3387-
curproxy->conf.logformat_sd_string = default_rfc5424_sd_log_format;
3387+
curproxy->logformat_sd.str = default_rfc5424_sd_log_format;
33883388
}
33893389
break;
33903390
}
33913391
}
33923392

33933393
/* compile the log format */
33943394
if (!(curproxy->cap & PR_CAP_FE)) {
3395-
if (curproxy->conf.logformat_string != default_http_log_format &&
3396-
curproxy->conf.logformat_string != default_tcp_log_format &&
3397-
curproxy->conf.logformat_string != clf_http_log_format)
3398-
free(curproxy->conf.logformat_string);
3399-
curproxy->conf.logformat_string = NULL;
3400-
ha_free(&curproxy->conf.lfs_file);
3401-
curproxy->conf.lfs_line = 0;
3402-
3403-
if (curproxy->conf.logformat_sd_string != default_rfc5424_sd_log_format)
3404-
free(curproxy->conf.logformat_sd_string);
3405-
curproxy->conf.logformat_sd_string = NULL;
3406-
ha_free(&curproxy->conf.lfsd_file);
3407-
curproxy->conf.lfsd_line = 0;
3408-
}
3409-
3410-
if (curproxy->conf.logformat_string) {
3395+
lf_expr_deinit(&curproxy->logformat);
3396+
lf_expr_deinit(&curproxy->logformat_sd);
3397+
}
3398+
3399+
if (curproxy->logformat.str) {
34113400
curproxy->conf.args.ctx = ARGC_LOG;
3412-
curproxy->conf.args.file = curproxy->conf.lfs_file;
3413-
curproxy->conf.args.line = curproxy->conf.lfs_line;
3401+
curproxy->conf.args.file = curproxy->logformat.conf.file;
3402+
curproxy->conf.args.line = curproxy->logformat.conf.line;
34143403
err = NULL;
3415-
if (!parse_logformat_string(curproxy->conf.logformat_string, curproxy, &curproxy->logformat,
3404+
if (!lf_expr_compile(&curproxy->logformat, &curproxy->conf.args,
34163405
LOG_OPT_MANDATORY|LOG_OPT_MERGE_SPACES,
3417-
SMP_VAL_FE_LOG_END, &err)) {
3406+
SMP_VAL_FE_LOG_END, &err) ||
3407+
!lf_expr_postcheck(&curproxy->logformat, curproxy, &err)) {
34183408
ha_alert("Parsing [%s:%d]: failed to parse log-format : %s.\n",
3419-
curproxy->conf.lfs_file, curproxy->conf.lfs_line, err);
3409+
curproxy->logformat.conf.file, curproxy->logformat.conf.line, err);
34203410
free(err);
34213411
cfgerr++;
34223412
}
34233413
curproxy->conf.args.file = NULL;
34243414
curproxy->conf.args.line = 0;
34253415
}
34263416

3427-
if (curproxy->conf.logformat_sd_string) {
3417+
if (curproxy->logformat_sd.str) {
34283418
curproxy->conf.args.ctx = ARGC_LOGSD;
3429-
curproxy->conf.args.file = curproxy->conf.lfsd_file;
3430-
curproxy->conf.args.line = curproxy->conf.lfsd_line;
3419+
curproxy->conf.args.file = curproxy->logformat_sd.conf.file;
3420+
curproxy->conf.args.line = curproxy->logformat_sd.conf.line;
34313421
err = NULL;
3432-
if (!parse_logformat_string(curproxy->conf.logformat_sd_string, curproxy, &curproxy->logformat_sd,
3422+
if (!lf_expr_compile(&curproxy->logformat_sd, &curproxy->conf.args,
34333423
LOG_OPT_MANDATORY|LOG_OPT_MERGE_SPACES,
3434-
SMP_VAL_FE_LOG_END, &err)) {
3435-
ha_alert("Parsing [%s:%d]: failed to parse log-format-sd : %s.\n",
3436-
curproxy->conf.lfsd_file, curproxy->conf.lfsd_line, err);
3437-
free(err);
3438-
cfgerr++;
3439-
} else if (!add_to_logformat_list(NULL, NULL, LF_SEPARATOR, &curproxy->logformat_sd, &err)) {
3424+
SMP_VAL_FE_LOG_END, &err) ||
3425+
!add_to_logformat_list(NULL, NULL, LF_SEPARATOR, &curproxy->logformat_sd, &err) ||
3426+
!lf_expr_postcheck(&curproxy->logformat_sd, curproxy, &err)) {
34403427
ha_alert("Parsing [%s:%d]: failed to parse log-format-sd : %s.\n",
3441-
curproxy->conf.lfsd_file, curproxy->conf.lfsd_line, err);
3428+
curproxy->logformat_sd.conf.file, curproxy->logformat_sd.conf.line, err);
34423429
free(err);
34433430
cfgerr++;
34443431
}
34453432
curproxy->conf.args.file = NULL;
34463433
curproxy->conf.args.line = 0;
34473434
}
34483435

3449-
if (curproxy->conf.uniqueid_format_string) {
3436+
if (curproxy->format_unique_id.str) {
34503437
int where = 0;
34513438

34523439
curproxy->conf.args.ctx = ARGC_UIF;
3453-
curproxy->conf.args.file = curproxy->conf.uif_file;
3454-
curproxy->conf.args.line = curproxy->conf.uif_line;
3440+
curproxy->conf.args.file = curproxy->format_unique_id.conf.file;
3441+
curproxy->conf.args.line = curproxy->format_unique_id.conf.line;
34553442
err = NULL;
34563443
if (curproxy->cap & PR_CAP_FE)
34573444
where |= SMP_VAL_FE_HRQ_HDR;
34583445
if (curproxy->cap & PR_CAP_BE)
34593446
where |= SMP_VAL_BE_HRQ_HDR;
3460-
if (!parse_logformat_string(curproxy->conf.uniqueid_format_string, curproxy, &curproxy->format_unique_id,
3461-
LOG_OPT_HTTP|LOG_OPT_MERGE_SPACES, where, &err)) {
3447+
if (!lf_expr_compile(&curproxy->format_unique_id, &curproxy->conf.args,
3448+
LOG_OPT_HTTP|LOG_OPT_MERGE_SPACES, where, &err) ||
3449+
!lf_expr_postcheck(&curproxy->format_unique_id, curproxy, &err)) {
34623450
ha_alert("Parsing [%s:%d]: failed to parse unique-id : %s.\n",
3463-
curproxy->conf.uif_file, curproxy->conf.uif_line, err);
3451+
curproxy->format_unique_id.conf.file, curproxy->format_unique_id.conf.line, err);
34643452
free(err);
34653453
cfgerr++;
34663454
}
34673455
curproxy->conf.args.file = NULL;
34683456
curproxy->conf.args.line = 0;
34693457
}
34703458

3471-
if (curproxy->conf.error_logformat_string) {
3459+
if (curproxy->logformat_error.str) {
34723460
curproxy->conf.args.ctx = ARGC_LOG;
3473-
curproxy->conf.args.file = curproxy->conf.elfs_file;
3474-
curproxy->conf.args.line = curproxy->conf.elfs_line;
3461+
curproxy->conf.args.file = curproxy->logformat_error.conf.file;
3462+
curproxy->conf.args.line = curproxy->logformat_error.conf.line;
34753463
err = NULL;
3476-
if (!parse_logformat_string(curproxy->conf.error_logformat_string, curproxy, &curproxy->logformat_error,
3464+
if (!lf_expr_compile(&curproxy->logformat_error, &curproxy->conf.args,
34773465
LOG_OPT_MANDATORY|LOG_OPT_MERGE_SPACES,
3478-
SMP_VAL_FE_LOG_END, &err)) {
3466+
SMP_VAL_FE_LOG_END, &err) ||
3467+
!lf_expr_postcheck(&curproxy->logformat_error, curproxy, &err)) {
34793468
ha_alert("Parsing [%s:%d]: failed to parse error-log-format : %s.\n",
3480-
curproxy->conf.elfs_file, curproxy->conf.elfs_line, err);
3469+
curproxy->logformat_error.conf.file, curproxy->logformat_error.conf.line, err);
34813470
free(err);
34823471
cfgerr++;
34833472
}

0 commit comments

Comments
 (0)