From: William Lallemand Date: Wed, 23 Apr 2025 13:32:46 +0000 (+0200) Subject: MINOR: httpclient: add an "https" log-format X-Git-Tag: v3.2-dev12~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d700a242b425c9bc04d3fe27e5a3b843e8376020;p=thirdparty%2Fhaproxy.git MINOR: httpclient: add an "https" log-format Add an experimental "https" log-format for the httpclient, it is not used by the httpclient by default, but could be define in a customized proxy. The string is basically a httpslog, with some of the fields replaced by their backend equivalent or - when not available: "%ci:%cp [%tr] %ft -/- %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[bc_err]/%[ssl_bc_err,hex]/-/-/%[ssl_bc_is_resumed] -/-/-" --- diff --git a/include/haproxy/log.h b/include/haproxy/log.h index ff69f7b0e..aec00e6ab 100644 --- a/include/haproxy/log.h +++ b/include/haproxy/log.h @@ -36,6 +36,7 @@ extern struct pool_head *pool_head_uniqueid; extern const char *log_levels[]; extern char *log_format; extern char httpclient_log_format[]; +extern char httpsclient_log_format[]; extern char default_tcp_log_format[]; extern char clf_tcp_log_format[]; extern char default_http_log_format[]; diff --git a/src/log.c b/src/log.c index 40bf0f64b..9ca619856 100644 --- a/src/log.c +++ b/src/log.c @@ -326,6 +326,7 @@ static const struct logformat_alias logformat_aliases[] = { }; char httpclient_log_format[] = "%ci:%cp [%tr] %ft -/- %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"; +char httpsclient_log_format[] = "%ci:%cp [%tr] %ft -/- %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[bc_err]/%[ssl_bc_err,hex]/-/-/%[ssl_bc_is_resumed] -/-/-"; char default_http_log_format[] = "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"; // default format char default_https_log_format[] = "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[fc_err]/%[ssl_fc_err,hex]/%[ssl_c_err]/%[ssl_c_ca_err]/%[ssl_fc_is_resumed] %[ssl_fc_sni]/%sslv/%sslc"; char clf_http_log_format[] = "%{+Q}o %{-Q}ci - - [%trg] %r %ST %B \"\" \"\" %cp %ms %ft %b %s %TR %Tw %Tc %Tr %Ta %tsc %ac %fc %bc %sc %rc %sq %bq %CC %CS %hrl %hsl"; @@ -344,6 +345,7 @@ char default_rfc5424_sd_log_format[] = "- "; static inline int logformat_str_isdefault(const char *str) { return str == httpclient_log_format || + str == httpsclient_log_format || str == default_http_log_format || str == default_https_log_format || str == clf_http_log_format ||