kamly commented on code in PR #9712:
URL: https://github.com/apache/apisix/pull/9712#discussion_r1254448027


##########
docs/zh/latest/plugins/file-logger.md:
##########
@@ -51,6 +51,27 @@ description: API 网关 Apache APISIX file-logger 插件可用于将日志数据
 | log_format       | object  | 否     | 以 JSON 格式的键值对来声明日志格式。对于值部分,仅支持字符串。如果是以 
`$` 开头,则表明是要获取 [APISIX 变量](../apisix-variable.md) 或 [NGINX 
内置变量](http://nginx.org/en/docs/varindex.html)。 |
 | include_resp_body      | boolean | 否     | 当设置为 `true` 时,生成的文件包含响应体。         
                                                                                
      |
 | include_resp_body_expr | array   | 否     | 当 `include_resp_body` 属性设置为 
`true` 时,使用该属性并基于 [lua-resty-expr](https://github.com/api7/lua-resty-expr) 
进行过滤。如果存在,则仅在表达式计算结果为 `true` 时记录响应。       |
+| vars        | array[] | 否   |  当规则匹配通过后才会记录日志。`vars` 是一个表达式列表,来自 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list)。   |
+
+:::tip
+
+`vars` 是由 [`lua-resty-expr`](https://github.com/api7/lua-resty-expr) 
的表达式组成的列表,它可以灵活的实现规则之间的 AND/OR 关系,示例如下::
+
+```json
+[
+    [
+        [ "arg_name","==","jack" ],
+        [ "arg_age","==",18 ]
+    ],
+    [
+        [ "arg_name2","==","allen" ]
+    ]
+]
+```
+
+以上示例表示前两个表达式之间的关系是 AND,而前两个和第三个表达式之间的关系是 OR。
+
+:::

Review Comment:
   fix



##########
docs/en/latest/plugins/file-logger.md:
##########
@@ -49,6 +49,27 @@ The `file-logger` Plugin is used to push log streams to a 
specific location.
 | log_format | object | False    | Log format declared as key value pairs in 
JSON format. Values only support strings. [APISIX](../apisix-variable.md) or 
[Nginx](http://nginx.org/en/docs/varindex.html) variables can be used by 
prefixing the string with `$`. |
 | include_resp_body      | boolean | False     | When set to `true` includes 
the response body in the log file.                                              
                                                                                
                                  |
 | include_resp_body_expr | array   | False     | When the `include_resp_body` 
attribute is set to `true`, use this to filter based on 
[lua-resty-expr](https://github.com/api7/lua-resty-expr). If present, only logs 
the response into file if the expression evaluates to `true`. |
+| vars        | array[] | False   |  Logs will be recorded only when the rule 
match is successful. See lua-resty-expr for a list of available expressions.   |
+
+:::tip
+
+`vars` 是由 [`lua-resty-expr`](https://github.com/api7/lua-resty-expr) 
的表达式组成的列表,它可以灵活的实现规则之间的 AND/OR 关系,示例如下::
+
+```json
+[
+    [
+        [ "arg_name","==","jack" ],
+        [ "arg_age","==",18 ]
+    ],
+    [
+        [ "arg_name2","==","allen" ]
+    ]
+]
+```
+
+以上示例表示前两个表达式之间的关系是 AND,而前两个和第三个表达式之间的关系是 OR。

Review Comment:
   fix



-- 
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