tzssangglass commented on code in PR #6960:
URL: https://github.com/apache/apisix/pull/6960#discussion_r869892336
##########
apisix/stream/xrpc/runner.lua:
##########
@@ -14,14 +14,22 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local require = require
local core = require("apisix.core")
+local expr = require("resty.expr.v1")
local pairs = pairs
local ngx = ngx
local ngx_now = ngx.now
local OK = ngx.OK
local DECLINED = ngx.DECLINED
local DONE = ngx.DONE
+local pcall = pcall
+local ipairs = ipairs
+local tostring = tostring
+local logger_expr_cache = core.lrucache.new({
+ ttl = 300, count = 32
Review Comment:
update
##########
apisix/stream/xrpc/runner.lua:
##########
@@ -71,9 +79,58 @@ local function put_req_ctx(session, ctx)
end
+local function filter_logger(ctx, logger)
+ if not logger then
+ return false
+ end
+
+ if not logger.filter or #logger.filter == 0 then
+ -- no valid filter, default execution plugin
+ return true
+ end
+
+ -- key and version are divided by per-logger level
+ local key = "xrpc-logger" .. ctx.conf_id
+ local version = tostring(logger.filter)
+ local filter_expr, err = logger_expr_cache(key, version, expr.new,
logger.filter)
+ if not filter_expr or err then
Review Comment:
update
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]