diff --git a/doc/configuration.txt b/doc/configuration.txt index 09705acb0..213febb76 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -927,6 +927,11 @@ file, or could be inherited by a program (See 3.7. Programs): defined in section 8.2.3 "HTTP log format". It can be used to override the default log format without having to copy the whole original definition. +* HAPROXY_HTTP_CLF_LOG_FMT: contains the value of the default HTTP CLF log + format as defined in section 8.2.3 "HTTP log format". It can be used to + override the default log format without having to copy the whole original + definition. + Example: # Add the rule that gave the final verdict to the log log-format "${HAPROXY_TCP_LOG_FMT} lr=last_rule_file:last_rule_line" @@ -937,6 +942,9 @@ file, or could be inherited by a program (See 3.7. Programs): * HAPROXY_TCP_LOG_FMT: similar to HAPROXY_HTTP_LOG_FMT but for TCP log format as defined in section 8.2.2 "TCP log format". +* HAPROXY_TCP_CLF_LOG_FMT: similar to HAPROXY_HTTP_CLF_LOG_FMT but for TCP CLF + log format as defined in section 8.2.2 "TCP log format". + * HAPROXY_MWORKER: In master-worker mode, this variable is set to 1. * HAPROXY_CLI: configured listeners addresses of the stats socket for every diff --git a/src/haproxy.c b/src/haproxy.c index daae45335..8946c657b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1189,8 +1189,10 @@ static int read_cfg(char *progname) * unset them after the list_for_each_entry loop. */ setenv("HAPROXY_HTTP_LOG_FMT", default_http_log_format, 1); + setenv("HAPROXY_HTTP_CLF_LOG_FMT", clf_http_log_format, 1); setenv("HAPROXY_HTTPS_LOG_FMT", default_https_log_format, 1); setenv("HAPROXY_TCP_LOG_FMT", default_tcp_log_format, 1); + setenv("HAPROXY_TCP_CLF_LOG_FMT", clf_tcp_log_format, 1); setenv("HAPROXY_BRANCH", PRODUCT_BRANCH, 1); list_for_each_entry_safe(cfg, cfg_tmp, &cfg_cfgfiles, list) { int ret; @@ -1220,8 +1222,10 @@ static int read_cfg(char *progname) /* remove temporary environment variables. */ unsetenv("HAPROXY_BRANCH"); unsetenv("HAPROXY_HTTP_LOG_FMT"); + unsetenv("HAPROXY_HTTP_CLF_LOG_FMT"); unsetenv("HAPROXY_HTTPS_LOG_FMT"); unsetenv("HAPROXY_TCP_LOG_FMT"); + unsetenv("HAPROXY_TCP_CLF_LOG_FMT"); /* do not try to resolve arguments nor to spot inconsistencies when * the configuration contains fatal errors.