]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: Created env variables for http and tcp clf formats
authorNathan Wehrman <nwehrman@haproxy.com>
Tue, 20 Aug 2024 16:11:34 +0000 (09:11 -0700)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Aug 2024 07:15:58 +0000 (09:15 +0200)
Since we already have variables for the other formats and the
change is trivial I thought it would be a nice addition for
completeness

doc/configuration.txt
src/haproxy.c

index 09705acb0fb94999400940492b910817f7be4477..213febb763c93e98b634238c659940e559de31ec 100644 (file)
@@ -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
index daae453350b6e399f780dd027a97553e94f11b06..8946c657ba405ae199a8024c3644b74c24b23891 100644 (file)
@@ -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.