Skip to content

Commit

Permalink
chore(logging): reduce excessive log flooding on debug logs (follow up)
Browse files Browse the repository at this point in the history
I merged the PR Kong/kong-ee#10652 prematurely.
This adds a couple of log messages back for testing.

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
  • Loading branch information
bungle committed Feb 13, 2025
1 parent da4c05a commit a6f6d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions kong/clustering/control_plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function _M:export_deflated_reconfigure_payload()
-- store serialized plugins map for troubleshooting purposes
local shm_key_name = "clustering:cp_plugins_configured:worker_" .. (worker_id() or -1)
kong_dict:set(shm_key_name, json_encode(self.plugins_configured))
kong.log.trace("plugin configuration map key: ", shm_key_name, " configuration: ", kong_dict:get(shm_key_name))
kong.log.trace(_log_prefix, "plugin configuration map key: ", shm_key_name, " configuration: ", kong_dict:get(shm_key_name))

local config_hash, hashes = calculate_config_hash(config_table)

Expand Down Expand Up @@ -374,7 +374,7 @@ function _M:handle_cp_websocket(cert)
return nil, "invalid websocket frame received from data plane: " .. typ
end

--ngx_log(ngx_DEBUG, _log_prefix, "received ping frame from data plane", log_suffix)
kong.log.trace(_log_prefix, "received ping frame from data plane", log_suffix)

config_hash = data
last_seen = ngx_time()
Expand Down Expand Up @@ -419,8 +419,8 @@ function _M:handle_cp_websocket(cert)

ngx_log(ngx_NOTICE, _log_prefix, "failed to send pong frame to data plane: ", err, log_suffix)

--else
-- ngx_log(ngx_DEBUG, _log_prefix, "sent pong frame to data plane", log_suffix)
else
kong.log.trace(_log_prefix, "sent pong frame to data plane", log_suffix)
end

-- pong ok
Expand Down
5 changes: 1 addition & 4 deletions kong/clustering/data_plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,7 @@ function _M:communicate(premature)
end

if typ == "pong" then
kong.log.trace(ngx_DEBUG, _log_prefix,
"received pong frame from control plane",
log_suffix)

kong.log.trace(_log_prefix, "received pong frame from control plane", log_suffix)
goto continue
end

Expand Down

0 comments on commit a6f6d42

Please sign in to comment.