Skip to content

Commit

Permalink
Revert "fix(syslog) ensure new facility field is compatible with olde…
Browse files Browse the repository at this point in the history
…r versions in hybrid mode (#7477)"

This reverts commit 15908e4.
  • Loading branch information
mayocream authored and dndx committed Mar 22, 2022
1 parent 88abdb8 commit 00cb781
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit 00cb781

Please sign in to comment.