Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(syslog) ensure new facility field is compatible with older versions in hybrid mode (#7477)" #8564

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions kong/plugins/syslog/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ local function log(premature, conf, message)
return
end

-- TODO: revert this commit and use schema to populate default value
-- in 2.7 or 3.0 whichever comes eearlier.
local facility = conf.facility or "user"

if message.response.status >= 500 then
send_to_syslog(conf.log_level, conf.server_errors_severity, message, facility)
send_to_syslog(conf.log_level, conf.server_errors_severity, message, conf.facility)

elseif message.response.status >= 400 then
send_to_syslog(conf.log_level, conf.client_errors_severity, message, facility)
send_to_syslog(conf.log_level, conf.client_errors_severity, message, conf.facility)

else
send_to_syslog(conf.log_level, conf.successful_severity, message, facility)
send_to_syslog(conf.log_level, conf.successful_severity, message, conf.facility)
end
end

Expand Down
2 changes: 2 additions & 0 deletions kong/plugins/syslog/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ local severity = {

local facility = {
type = "string",
default = "user",
required = true,
one_of = { "auth", "authpriv", "cron", "daemon",
"ftp", "kern", "lpr", "mail",
"news", "syslog", "user", "uucp",
Expand Down