bisakhmondal commented on a change in pull request #6228:
URL: https://github.com/apache/apisix/pull/6228#discussion_r801290899



##########
File path: apisix/plugins/loggly.lua
##########
@@ -145,6 +157,18 @@ function _M.check_schema(conf, schema_type)
     if not ok then
         return nil, err
     end
+
+    if conf.severity_map then
+        local cache = {}
+        for k, v in pairs(conf.severity_map) do
+            local rcode = tonumber(k)
+            if not rcode or rcode < 100 or rcode >= 600 then
+                return nil, "expecting severity_map with http response 
code([100,599]) as keys"
+            end
+            cache[k] = severity[v:upper()]

Review comment:
       I think I avoid that due to the default behaviour of cjson encoding 
`Cannot serialise table: excessively sparse array`. 
   we can override the behaviour by `cjson.encode_sparse_array(true)`. In this 
case, I thought I don't need it that's why I am sticking with strings. WDYT?




-- 
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-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to