BUG/MINOR: cfgparse: report proper location for log-format-sd errors
When a parsing error occurs inside a log-format-sd expression, we report
the location of the log-format directive (which may not be set) instead
of reporting the proper log-format-sd directive location where the parsing
error occured.
1|listen test
2| log-format "%B" # no error
3| log-format-sd "%bad" # error
| [ALERT] (322261) : config : Parsing [empty.conf:2]: failed to parse log-format-sd : no such format variable 'bad'. If you wanted to emit the '%' character verbatim, you need to use '%%'.
The fix consists in using the config hints dedicated to log-format-sd
directive instead of the log-format one.
The bug was introduced in 8a4e4420 ("MEDIUM: log-format: Use standard
HAProxy log system to report errors").
This should be backported to every stable versions.
(cherry picked from commit cf37e4cc1b8c63c437c6825d2e70588a6ccb8847)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit b96571217dc0e3ef5abc6fc595ef9281a3df3804)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit cdb464eabc36fddec59820d3e2c8e519ed4dafde)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 9d4f844d5ea66afd6048d7cc1256b8b15e1b7aa7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit aafe5ae21675e38caa66746d6b945c2f70b172c9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed