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 <[email protected]>
  • Loading branch information
bungle committed Feb 14, 2025
1 parent ad18d7d commit 5badd8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/busted
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
setmetatable(_G, nil)

local pl_path = require("pl.path")

local pl_file = require("pl.file")

local tools_system = require("kong.tools.system")
Expand Down Expand Up @@ -47,6 +46,7 @@ if not os.getenv("KONG_BUSTED_RESPAWNED") then
end
-- add cli recursion detection
table.insert(script, "export KONG_BUSTED_RESPAWNED=1")
table.insert(script, "export KONG_IS_TESTING=1")

-- rebuild the invoked commandline, while inserting extra resty-flags
local resty_flags = DEFAULT_RESTY_FLAGS
Expand Down
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

1 comment on commit 5badd8e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong-dev:5badd8e1ad63ea2081d44f0fff90a9fa6973b6b8
Artifacts available https://github.com/Kong/kong/actions/runs/13330904410

Please sign in to comment.