Skip to content

Commit

Permalink
debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 6, 2024
1 parent f6360d9 commit a14591f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local _M = {}
local _MT = { __index = _M, }


local cjson = require("cjson.safe")
local txn = require("resty.lmdb.transaction")
local declarative = require("kong.db.declarative")
local constants = require("kong.constants")
Expand All @@ -24,6 +25,7 @@ local ngx_log = ngx.log
local ngx_ERR = ngx.ERR
local ngx_INFO = ngx.INFO
local ngx_DEBUG = ngx.DEBUG
local cjson_encode = cjson.encode


-- number of versions behind before a full sync is forced
Expand Down Expand Up @@ -269,6 +271,11 @@ local function do_sync()
return nil, err
end

ngx_log(ngx_DEBUG,
"[kong.sync.v2] update entity",
", type ", delta_type,
", pk:", cjson_encode(delta.pk))

ev = { delta_type, crud_event_type, delta_entity, old_entity, }

else
Expand All @@ -286,6 +293,11 @@ local function do_sync()
end
end

ngx_log(ngx_DEBUG,
"[kong.sync.v2] delete entity",
", type ", delta_type,
", pk:", cjson_encode(delta.pk))

ev = { delta_type, "delete", old_entity, }
end

Expand Down

0 comments on commit a14591f

Please sign in to comment.