]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: rename 'dontloglegacyconnerr' to 'log-error-via-logformat'
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 2 Aug 2021 08:25:30 +0000 (10:25 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 2 Aug 2021 08:42:42 +0000 (10:42 +0200)
Rename the 'dontloglegacyconnerr' option to 'log-error-via-logformat'
which is much more self-explanatory and readable.

Note: only legacy keywords don't use hyphens, it is recommended to
separate words with them in new keywords.

doc/configuration.txt
include/haproxy/proxy-t.h
reg-tests/ssl/ssl_errors.vtc
src/proxy.c
src/session.c

index 6a820b3c8c2cedaaffbaf5458836da452ad924d1..5c860b8021bfbc1eb836e8def956d4828b8e1286 100644 (file)
@@ -9033,8 +9033,8 @@ no option logasap
              logging.
 
 
-option dontloglegacyconnerr
-no option dontloglegacyconnerr
+option log-error-via-logformat
+no option log-error-via-logformat
   Enable or disable dedicated connection error logging.
   May be used in sections :   defaults | frontend | listen | backend
                                  yes   |    yes   |   yes  |   no
@@ -21001,7 +21001,7 @@ protocol header, HAProxy will log the event using a shorter, fixed line format.
 By default, logs are emitted at the LOG_INFO level, unless the option
 "log-separate-errors" is set in the backend, in which case the LOG_ERR level
 will be used. Connections on which no data are exchanged (e.g. probes) are not
-logged if the "dontlognull" option is set. If the "dontloglegacyconnerr" option
+logged if the "dontlognull" option is set. If the "log-error-via-logformat" option
 is set, those messages are not emitted and a line following the configured
 log-format is emitted instead.
 
index 47571e8955c556e436839d75ff58649afee34b41..f2a3e7d0bab392a5b24a5dc8fc0400a94d65f182 100644 (file)
@@ -95,8 +95,7 @@ enum PR_SRV_STATE_FILE {
 #define PR_O_FF_ALWAYS  0x00002000      /* always set x-forwarded-for */
 #define PR_O_PERSIST    0x00004000      /* server persistence stays effective even when server is down */
 #define PR_O_LOGASAP    0x00008000      /* log as soon as possible, without waiting for the stream to complete */
-#define PR_O_NOLGCYCONNERR 0x00010000   /* log a dedicated error log message in case of connection failure instead of the legacy connection error message */
-
+#define PR_O_ERR_LOGFMT 0x00010000      /* use log-format for connection error message */
 #define PR_O_CHK_CACHE  0x00020000      /* require examination of cacheability of the 'set-cookie' field */
 #define PR_O_TCP_CLI_KA 0x00040000      /* enable TCP keep-alive on client-side streams */
 #define PR_O_TCP_SRV_KA 0x00080000      /* enable TCP keep-alive on server-side streams */
index b131dc646183960989688d04d4e47e1f96e8ae7a..f138249158efa516d0cb239a3227db51dcb2354a 100644 (file)
@@ -2,7 +2,7 @@
 
 # This reg-test checks that the connection and SSL sample fetches related to
 # errors are functioning properly. It also tests the proper behaviour of the
-# default HTTPS log format and of the dontloglegacyconnerr option which enables
+# default HTTPS log format and of the log-error-via-logformat option which enables
 # or disables the output of a special error message in case of connection
 # failure (otherwise a line following the configured log-format is output).
 #
@@ -18,7 +18,7 @@
 # syslog messages arrive in the right order.
 #
 # In order to ensure that the log line raised in case of connection error if
-# the dontloglegacyconnerr option is disabled still follows the
+# the log-error-via-logformat option is disabled still follows the
 # log-separate-error option, the log lines raised by the https_fmt_lst listener
 # will be sent to two separate syslog servers.
 #
@@ -134,7 +134,7 @@ haproxy h1 -conf {
 
     listen cust_logfmt_ssl_lst
         log ${Slg_cust_fmt_addr}:${Slg_cust_fmt_port} local0
-       option dontloglegacyconnerr
+       option log-error-via-logformat
         mode http
         log-format "conn_status:\"%[fc_conn_err]:%[fc_conn_err_str]\" hsk_err:\"%[ssl_fc_hsk_err]:%[ssl_fc_hsk_err_str]\""
         bind "${tmpdir}/cust_logfmt_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-verify-file ${testdir}/set_cafile_rootCA.crt ca-file ${testdir}/set_cafile_interCA1.crt verify required ciphersuites "TLS_AES_256_GCM_SHA384"
@@ -143,7 +143,7 @@ haproxy h1 -conf {
     listen https_logfmt_ssl_lst
         log ${Slg_https_fmt_addr}:${Slg_https_fmt_port} local0 info
         log ${Slg_https_fmt_err_addr}:${Slg_https_fmt_err_port} local0 err info
-       option dontloglegacyconnerr
+       option log-error-via-logformat
         option log-separate-errors
         mode http
         option httpslog
index 63546d2d3b5fc588693cffa631538da8b4422e65..245c22b9e5b2b93e49c2f7eaabc0744d05a29850 100644 (file)
@@ -72,7 +72,7 @@ const struct cfg_opt cfg_opts[] =
        { "http-ignore-probes", PR_O_IGNORE_PRB, PR_CAP_FE, 0, PR_MODE_HTTP },
        { "prefer-last-server", PR_O_PREF_LAST,  PR_CAP_BE, 0, PR_MODE_HTTP },
        { "logasap",      PR_O_LOGASAP,    PR_CAP_FE, 0, 0 },
-       { "dontloglegacyconnerr", PR_O_NOLGCYCONNERR, PR_CAP_FE, 0, 0 },
+       { "log-error-via-logformat", PR_O_ERR_LOGFMT, PR_CAP_FE, 0, 0 },
        { "nolinger",     PR_O_TCP_NOLING, PR_CAP_FE | PR_CAP_BE, 0, 0 },
        { "persist",      PR_O_PERSIST,    PR_CAP_BE, 0, 0 },
        { "srvtcpka",     PR_O_TCP_SRV_KA, PR_CAP_BE, 0, 0 },
index 8b830639fe298145c8d7a05eff736e13b48028ac..92d03eaed4bfd73f7d7eb4cbe3c7986b50a5d915 100644 (file)
@@ -357,7 +357,7 @@ static void session_kill_embryonic(struct session *sess, unsigned int state)
                                conn->err_code = CO_ER_SSL_TIMEOUT;
                }
 
-               if (sess->fe->options & PR_O_NOLGCYCONNERR) {
+               if (sess->fe->options & PR_O_ERR_LOGFMT) {
                        /* Display a log line following the configured log-format. */
                        sess_log(sess);
                }