mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MINOR: log: fix log-format parsing errors
Some errors were still reported as log-format instead of their respective contexts (acl, request header, stick, ...). This is harmless and does not require any backport.
This commit is contained in:
parent
34c2fb6f89
commit
bf0addb6ce
20
src/log.c
20
src/log.c
@ -166,15 +166,23 @@ struct logformat_var_args var_args_list[] = {
|
|||||||
*/
|
*/
|
||||||
static inline const char *fmt_directive(const struct proxy *curproxy)
|
static inline const char *fmt_directive(const struct proxy *curproxy)
|
||||||
{
|
{
|
||||||
if (curproxy->conf.args.ctx == ARGC_UIF)
|
switch (curproxy->conf.args.ctx) {
|
||||||
|
case ARGC_UIF:
|
||||||
return "unique-id-format";
|
return "unique-id-format";
|
||||||
else if (curproxy->conf.args.ctx == ARGC_HRQ)
|
case ARGC_HRQ:
|
||||||
return "http-request";
|
return "http-request";
|
||||||
else if (curproxy->conf.args.ctx == ARGC_HRS)
|
case ARGC_HRS:
|
||||||
return "http-response";
|
return "http-response";
|
||||||
else
|
case ARGC_STK:
|
||||||
|
return "stick";
|
||||||
|
case ARGC_TRK:
|
||||||
|
return "track-sc"; break;
|
||||||
|
case ARGC_ACL:
|
||||||
|
return "acl"; break;
|
||||||
|
default:
|
||||||
return "log-format";
|
return "log-format";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* callback used to configure addr source retrieval
|
* callback used to configure addr source retrieval
|
||||||
@ -277,7 +285,7 @@ int parse_logformat_var(char *arg, int arg_len, char *var, int var_len, struct p
|
|||||||
logformat_keywords[j].name, fmt_directive(curproxy), logformat_keywords[j].replace_by);
|
logformat_keywords[j].name, fmt_directive(curproxy), logformat_keywords[j].replace_by);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
Warning("parsing [%s:%d] : '%s' variable name '%s' is reserved for HTTP mode\n",
|
Warning("parsing [%s:%d] : '%s' : format variable '%s' is reserved for HTTP mode\n",
|
||||||
curproxy->conf.args.file, curproxy->conf.args.line, fmt_directive(curproxy),
|
curproxy->conf.args.file, curproxy->conf.args.line, fmt_directive(curproxy),
|
||||||
logformat_keywords[j].name);
|
logformat_keywords[j].name);
|
||||||
return -1;
|
return -1;
|
||||||
@ -287,7 +295,7 @@ int parse_logformat_var(char *arg, int arg_len, char *var, int var_len, struct p
|
|||||||
|
|
||||||
j = var[var_len];
|
j = var[var_len];
|
||||||
var[var_len] = 0;
|
var[var_len] = 0;
|
||||||
Warning("parsing [%s:%d] : no such variable name '%s' in '%s'\n",
|
Warning("parsing [%s:%d] : no such format variable '%s' in '%s'\n",
|
||||||
curproxy->conf.args.file, curproxy->conf.args.line, var, fmt_directive(curproxy));
|
curproxy->conf.args.file, curproxy->conf.args.line, var, fmt_directive(curproxy));
|
||||||
var[var_len] = j;
|
var[var_len] = j;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user