tzssangglass commented on code in PR #7036:
URL: https://github.com/apache/apisix/pull/7036#discussion_r871975472


##########
docs/en/latest/apisix-variable.md:
##########
@@ -39,5 +39,7 @@ List in alphabetical order:
 | route_name       | core    | name of `route`        |   |
 | service_id       | core    | id of `service`        |   |
 | service_name     | core    | name of `service`      |   |
+| rpc_time         | xRPC    | time spent at the rpc request level |   |
+| redis_cmd_line   | redis   | the type of Redis command |   |

Review Comment:
   update



##########
docs/en/latest/xrpc.md:
##########
@@ -131,6 +131,52 @@ One specifies the `superior_id`, whose corresponding value 
is the ID of another
 
 For example, for the Dubbo RPC protocol, the subordinate route is matched 
based on the service_name and other parameters configured in the route and the 
actual service_name brought in the request. If the match is successful, the 
configuration above the subordinate route is used, otherwise the configuration 
of the superior route is still used. In the above example, if the match for 
route 2 is successful, it will be forwarded to upstream 2; otherwise, it will 
still be forwarded to upstream 1.
 
+### Log Reporting
+
+xRPC supports logging-related functions. You can use this feature to filter 
requests that require attention, such as high latency, excessive transfer 
content, etc.
+
+Each logger item configuration parameter will contain
+
+- name: the Logger plugin name,
+- filter: the prerequisites for the execution of the logger plugin(e.g., 
request processing time exceeding a given value),
+- conf: the configuration of the logger plugin itself.
+
+ The following configuration is an example:
+
+```json
+{
+    ...
+    "protocol": {
+        "name": "redis",
+        "logger": {
+            {
+                "name": "syslog",
+                "filter": [
+                    ["rpc_time", ">=", 10]
+                ],
+                "conf": {
+                    "host": "127.0.0.1",
+                    "port": 8125,
+                }
+            }
+        }
+    }
+}
+```
+
+This configuration means that when the `rpc_time` is greater than 10 ms, xPRC 
reports the request log to the log server via the `syslog` plugin. `conf` is 
the configuration of the logging server required by the `syslog` plugin.
+
+Unlike standard TCP proxies, which only execute a logger when the connection 
is broken, xRPC's executed logger at the end of each 'request'.

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]

Reply via email to