When adding/modifying logs, follow these rules:
1) Use the Kong logging API
kong.log.<level> (e.g., kong.log.err(...)) over ngx.log(...) to keep logging consistent with Kong conventions.2) Pick the right level (avoid noise)
warn/err (e.g., log payloads at debug only).3) Make error messages actionable
4) Log enough context to diagnose failures, but in the right layer
Example pattern:
-- Prefer kong.log over ngx.log
local ok, err = send_entries(conf, { entry })
if not ok then
kong.log.err(string.format(
"could not send http-log entries; giving up after max_retry_time=%d exceeded",
conf.max_retry_time
))
-- keep any success traces at debug, and avoid spamming timers
end
Apply this checklist across plugins, clustering/rpc, queue/timer processing, and any new debug instrumentation.
Enter the URL of a public GitHub repository