You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/29 02:28:46 UTC
[GitHub] [apisix] spacewander commented on a change in pull request #6228: feat(loggly): support HTTP response code to SYSLOG severity mapping
spacewander commented on a change in pull request #6228:
URL: https://github.com/apache/apisix/pull/6228#discussion_r794986279
##########
File path: apisix/plugins/loggly.lua
##########
@@ -184,9 +202,18 @@ local function generate_log_message(conf, ctx)
core.table.insert(taglist, "tag=\"" .. conf.tags[i] .. "\"")
end
end
+
+ local message_severity = severity[conf.severity:upper()]
Review comment:
Let's do the conversion in `check_schema` so we don't need to do it per request.
##########
File path: apisix/plugins/loggly.lua
##########
@@ -145,6 +150,19 @@ function _M.check_schema(conf, schema_type)
if not ok then
return nil, err
end
+
+ if conf.severity_map then
+ for k, v in pairs(conf.severity_map) do
+ local rcode = tonumber(k)
Review comment:
We can do part of the validation in jsonschema? Like https://github.com/apache/apisix/blob/82d17abf9987528856cbd20ce5f17f2ae0a799ce/apisix/schema_def.lua#L94
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org