diff --git a/doc/configuration.txt b/doc/configuration.txt index 6a820b3c8..5c860b802 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -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. diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 47571e895..f2a3e7d0b 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -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 */ diff --git a/reg-tests/ssl/ssl_errors.vtc b/reg-tests/ssl/ssl_errors.vtc index b131dc646..f13824915 100644 --- a/reg-tests/ssl/ssl_errors.vtc +++ b/reg-tests/ssl/ssl_errors.vtc @@ -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 diff --git a/src/proxy.c b/src/proxy.c index 63546d2d3..245c22b9e 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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 }, diff --git a/src/session.c b/src/session.c index 8b830639f..92d03eaed 100644 --- a/src/session.c +++ b/src/session.c @@ -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); }