Skip to content

Commit

Permalink
chore(helpers): do not display debug log when 500
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Sep 25, 2023
1 parent 769bc69 commit 78168f0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2402,9 +2402,17 @@ local function res_status(state, args)
return false -- no err logs to read in this prefix
end

local str_t = pl_stringx.splitlines(str)
local lines_t = pl_stringx.splitlines(str)
local str_t = {}
-- filter out debugs as they are not usually useful in this context
for i = 1, #lines_t do
if not lines_t[i]:match(" %[debug%] ") then
table.insert(str_t, lines_t[i])
end
end

local first_line = #str_t - math.min(60, #str_t) + 1
local msg_t = {"\nError logs (" .. conf.nginx_err_logs .. "):"}
local msg_t = {"\nError logs (" .. conf.nginx_err_logs .. "), only last 60 non-debug logs are displayed:"}
for i = first_line, #str_t do
msg_t[#msg_t+1] = str_t[i]
end
Expand Down

1 comment on commit 78168f0

@khcp-gha-bot
Copy link

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:78168f0fa5347ed17a41392e1b5da12a3f8ca6d5
Artifacts available https://github.com/Kong/kong/actions/runs/6295457965

Please sign in to comment.