diff --git a/doc/admin-guide/logging/formatting.en.rst b/doc/admin-guide/logging/formatting.en.rst index d87fa62659d..76a4dc10674 100644 --- a/doc/admin-guide/logging/formatting.en.rst +++ b/doc/admin-guide/logging/formatting.en.rst @@ -193,6 +193,8 @@ Connections and Transactions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. _sca: +.. _surc: +.. _ssrc: .. _sstc: .. _ccid: .. _ctid: @@ -207,6 +209,8 @@ Field Source Description ===== ============== ================================================================== sca Proxy Number of attempts within the current transaction by |TS| in connecting to the origin server. +surc Proxy Parent unavailable retry count within the current transaction by |TS|. +ssrc Proxy Parent simple server retry count within the current transaction by |TS|. sstc Proxy Number of transactions between the |TS| proxy and the origin server from a single session. Any value greater than zero indicates connection reuse. diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index 4ab29e90402..266090ebf5e 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -831,6 +831,16 @@ Log::init_fields() global_field_list.add(field, false); field_symbol_hash.emplace("sstc", field); + field = new LogField("server_unavailable_retry_count", "surc", LogField::sINT, &LogAccess::marshal_server_unavailable_retry_count, + &LogAccess::unmarshal_int_to_str); + global_field_list.add(field, false); + field_symbol_hash.emplace("surc", field); + + field = new LogField("server_simple_retry_count", "ssrc", LogField::sINT, &LogAccess::marshal_server_simple_retry_count, + &LogAccess::unmarshal_int_to_str); + global_field_list.add(field, false); + field_symbol_hash.emplace("ssrc", field); + field = new LogField("server_connect_attempts", "sca", LogField::sINT, &LogAccess::marshal_server_connect_attempts, &LogAccess::unmarshal_int_to_str); global_field_list.add(field, false); diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc index 56ff3cc4d6d..2909383c757 100644 --- a/proxy/logging/LogAccess.cc +++ b/proxy/logging/LogAccess.cc @@ -2626,6 +2626,32 @@ LogAccess::marshal_server_transact_count(char *buf) return INK_MIN_ALIGN; } +/*------------------------------------------------------------------------- + -------------------------------------------------------------------------*/ + +int +LogAccess::marshal_server_simple_retry_count(char *buf) +{ + if (buf) { + const int64_t attempts = m_http_sm->t_state.current.simple_retry_attempts; + marshal_int(buf, attempts); + } + return INK_MIN_ALIGN; +} + +/*------------------------------------------------------------------------- + -------------------------------------------------------------------------*/ + +int +LogAccess::marshal_server_unavailable_retry_count(char *buf) +{ + if (buf) { + const int64_t attempts = m_http_sm->t_state.current.unavailable_server_retry_attempts; + marshal_int(buf, attempts); + } + return INK_MIN_ALIGN; +} + /*------------------------------------------------------------------------- -------------------------------------------------------------------------*/ diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index c95ad18431f..08bfb8f3953 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -195,18 +195,20 @@ class LogAccess // // server -> proxy fields // - int marshal_server_host_ip(char *); // INT - int marshal_server_host_name(char *); // STR - int marshal_server_resp_status_code(char *); // INT - int marshal_server_resp_squid_len(char *); // INT - int marshal_server_resp_content_len(char *); // INT - int marshal_server_resp_header_len(char *); // INT - int marshal_server_resp_http_version(char *); // INT - int marshal_server_resp_time_ms(char *); // INT - int marshal_server_resp_time_s(char *); // INT - int marshal_server_transact_count(char *); // INT - int marshal_server_connect_attempts(char *); // INT - int marshal_server_resp_all_header_fields(char *); // STR + int marshal_server_host_ip(char *); // INT + int marshal_server_host_name(char *); // STR + int marshal_server_resp_status_code(char *); // INT + int marshal_server_resp_squid_len(char *); // INT + int marshal_server_resp_content_len(char *); // INT + int marshal_server_resp_header_len(char *); // INT + int marshal_server_resp_http_version(char *); // INT + int marshal_server_resp_time_ms(char *); // INT + int marshal_server_resp_time_s(char *); // INT + int marshal_server_transact_count(char *); // INT + int marshal_server_simple_retry_count(char *); // INT + int marshal_server_unavailable_retry_count(char *); // INT + int marshal_server_connect_attempts(char *); // INT + int marshal_server_resp_all_header_fields(char *); // STR // // cache -> client fields