mcy567 commented on code in PR #8265: URL: https://github.com/apache/apisix/pull/8265#discussion_r1017590182
########## apisix/plugins/rizhiyi-logger.lua: ########## @@ -0,0 +1,153 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +local core = require("apisix.core") +local log_util = require("apisix.utils.log-util") +local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local plugin = require("apisix.plugin") + +local tcp = ngx.socket.tcp + +local plugin_name = "rizhiyi-logger" +local batch_processor_manager = bp_manager_mod.new(plugin_name) + +---calc pri--- +local Facility = { Review Comment: > > 如果syslog插件支持定义syslog的元数据格式和内容 > > we can also set the format of the logs by configuring the Plugin metadata , ref: https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/sls-logger.md#metadata > > Even though the syslog documentation doesn't say so, it should be supported and used the same way. You can help to verify it. 插件的元数据貌似指的是syslog中%msg%的格式,而不是syslog的元数据。 比如一段syslog日志:**<46>1 2022-11-09T08:15:27.424Z 172.21.48.10 apisix - - [076b9e730462faea7036c04ed314e627@32473 tag="docker,logger"]** {"host":"172.21.48.10","route_id":"17","@timestamp":"2022-11-09T08:15:27+00:00","client_ip":"172.21.48.10"} 我说的元数据指的是**粗体**的部分,插件的元数据指的的是非粗体的部分(如果我没理解错的话)。 -- 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