You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/22 06:00:06 UTC

[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7688: docs: refactor loggers plugin doc(1)

SylviaBABY commented on code in PR #7688:
URL: https://github.com/apache/apisix/pull/7688#discussion_r951034051


##########
docs/zh/latest/plugins/clickhouse-logger.md:
##########
@@ -23,72 +29,35 @@ title: clickhouse-logger
 
 ## 描述
 
-`clickhouse-logger` 是一个插件,可将 Log 数据请求推送到 clickhouse 服务器。
+`clickhouse-logger` 插件可用于将日志数据推送到 [ClickHouse](https://github.com/ClickHouse/ClickHouse) 数据库中。
 
 ## 属性
 
-| 名称             | 类型    | 必选项 | 默认值        | 有效值  | 描述                                                 |
-| ---------------- | ------- | ------ | ------------- | ------- | ------------------------------------------------  |
-| endpoint_addr    | 废弃    | 必须   |               |         | 推荐使用 `endpoint_addrs` 代替。`clickhouse` 服务器的 endpoints。|
-| endpoint_addrs   | array    | 必须   |               |         | `clickhouse` 服务器的 endpoints。|
-| database         | string  | 必须   |               |         | 使用的数据库。                                      |
-| logtable         | string  | 必须   |               |         | 写入的表名 。                                       |
-| user             | string  | 必须   |               |         | clickhouse 的用户。                                |
-| password         | string  | 必须   |               |         | clickhouse 的密码 。                               |
-| timeout          | integer | 可选   | 3             | [1,...] | 发送请求后保持连接活动的时间。                       |
-| name             | string  | 可选   | "clickhouse logger" |         | 标识 logger 的唯一标识符。                    |
-| ssl_verify       | boolean | 可选   | true          | [true,false] | 验证证书。                                    |
+| 名称             | 类型    | 必选项  | 默认值              | 有效值       | 描述                                                     |
+| ---------------- | ------- | ------ | ------------------- | ----------- | -------------------------------------------------------- |
+| endpoint_addr    | 废弃    | 是     |                     |              | 请使用 `endpoint_addrs` 代替。ClickHouse 的 `endpoints`。 |

Review Comment:
   ```suggestion
   | endpoint_addr    | 废弃    | 是     |                     |              | 请使用 `endpoint_addrs` 代替 ClickHouse 的 `endpoints`。 |
   ```



##########
docs/zh/latest/plugins/clickhouse-logger.md:
##########
@@ -23,72 +29,35 @@ title: clickhouse-logger
 
 ## 描述
 
-`clickhouse-logger` 是一个插件,可将 Log 数据请求推送到 clickhouse 服务器。
+`clickhouse-logger` 插件可用于将日志数据推送到 [ClickHouse](https://github.com/ClickHouse/ClickHouse) 数据库中。
 
 ## 属性
 
-| 名称             | 类型    | 必选项 | 默认值        | 有效值  | 描述                                                 |
-| ---------------- | ------- | ------ | ------------- | ------- | ------------------------------------------------  |
-| endpoint_addr    | 废弃    | 必须   |               |         | 推荐使用 `endpoint_addrs` 代替。`clickhouse` 服务器的 endpoints。|
-| endpoint_addrs   | array    | 必须   |               |         | `clickhouse` 服务器的 endpoints。|
-| database         | string  | 必须   |               |         | 使用的数据库。                                      |
-| logtable         | string  | 必须   |               |         | 写入的表名 。                                       |
-| user             | string  | 必须   |               |         | clickhouse 的用户。                                |
-| password         | string  | 必须   |               |         | clickhouse 的密码 。                               |
-| timeout          | integer | 可选   | 3             | [1,...] | 发送请求后保持连接活动的时间。                       |
-| name             | string  | 可选   | "clickhouse logger" |         | 标识 logger 的唯一标识符。                    |
-| ssl_verify       | boolean | 可选   | true          | [true,false] | 验证证书。                                    |
+| 名称             | 类型    | 必选项  | 默认值              | 有效值       | 描述                                                     |
+| ---------------- | ------- | ------ | ------------------- | ----------- | -------------------------------------------------------- |
+| endpoint_addr    | 废弃    | 是     |                     |              | 请使用 `endpoint_addrs` 代替。ClickHouse 的 `endpoints`。 |
+| endpoint_addrs   | array   | 是     |                     |              | ClickHouse 的 endpoints。                                |
+| database         | string  | 是     |                     |              | 使用的数据库。                                            |
+| logtable         | string  | 是     |                     |              | 写入的表名。                                              |
+| user             | string  | 是     |                     |              | ClickHouse 的用户。                                       |
+| password         | string  | 是     |                     |              | ClickHouse 的密码 。                                      |
+| timeout          | integer | 否     | 3                   | [1,...]      | 发送请求后保持连接活动的时间。                             |
+| name             | string  | 否     | "clickhouse logger" |              | 标识 logger 的唯一标识符。                                |
+| ssl_verify       | boolean | 否     | true                | [true,false] | 当设置为 `true` 时,验证证书。                                                |
 
-本插件支持使用批处理器来聚合并批量处理条目(日志/数据)。这样可以避免插件频繁地提交数据,默认设置情况下批处理器会每 `5` 秒钟或队列中的数据达到 `1000` 条时提交数据,如需了解或自定义批处理器相关参数设置,请参考 [Batch-Processor](../batch-processor.md#配置) 配置部分。
+该插件支持使用批处理器来聚合并批量处理条目(日志/数据)。这样可以避免插件频繁地提交数据,默认情况下批处理器每 `5` 秒钟或队列中的数据达到 `1000` 条时提交数据,如需了解批处理器相关参数设置,请参考 [Batch-Processor](../batch-processor.md#配置)。
 
-## 如何开启
+## 配置插件元数据
 
-如果配置多个 endpoints 将随机写入。
-这是有关如何为特定路由启用 `clickhouse-logger` 插件的示例。
-
-```shell
-curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-      "plugins": {
-            "clickhouse-logger": {
-                "user": "default",
-                "password": "a",
-                "database": "default",
-                "logtable": "test",
-                "endpoint_addrs": ["http://127.0.0.1:8123"]
-            }
-       },
-      "upstream": {
-           "type": "roundrobin",
-           "nodes": {
-               "127.0.0.1:1980": 1
-           }
-      },
-      "uri": "/hello"
-}'
-```
-
-## 测试插件
-
-> 成功:
-
-```shell
-$ curl -i http://127.0.0.1:9080/hello
-HTTP/1.1 200 OK
-...
-hello, world
-```
-
-## 插件元数据设置
+`skywalking-logger` 也支持自定义日志格式,与 [http-logger](./http-logger.md) 插件类似。

Review Comment:
   clickhouse-logger?



##########
docs/zh/latest/plugins/error-log-logger.md:
##########
@@ -114,16 +105,15 @@ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/error-log-logger -H 'X-A
 }'
 ```
 
-## 如何设置接收日志的 clickhouse 数据库
+### 如何设置接收日志的 ClickHouse 数据库

Review Comment:
   ```suggestion
   ### 配置 ClickHouse 数据库
   ```



##########
docs/zh/latest/plugins/log-rotate.md:
##########
@@ -96,6 +95,17 @@ plugin_attr:
         enable_compression: false    # enable log file compression(gzip) or not, default false
 ```
 
-#### 禁用插件
+配置完成,你需要重新加载 APISIX。
 
-在 `conf/config.yaml` 中删除插件 `log-rotate` 即可。
+## 禁用插件
+
+当你不在需要该插件是,只需要在 `./conf/config.yaml` 中删除或注释该插件即可。

Review Comment:
   ```suggestion
   当你不再需要该插件时,只需要在 `./conf/config.yaml` 中删除或注释该插件即可。
   ```



##########
docs/zh/latest/plugins/clickhouse-logger.md:
##########
@@ -111,20 +80,61 @@ CREATE TABLE default.test (
 ) ENGINE = MergeTree()
 ```
 
-在 clickhouse 上执行`select * from default.test;`,将得到类似下面的数据:
+在 ClickHouse 中执行`select * from default.test;`,将得到类似下面的数据:
 
 ```
 ┌─host──────┬─client_ip─┬─route_id─┬─@timestamp────────────────┐
 │ 127.0.0.1 │ 127.0.0.1 │ 1        │ 2022-01-17T10:03:10+08:00 │
 └───────────┴───────────┴──────────┴───────────────────────────┘
 ```
 
+## 启用插件
+
+你可以通过以下命令在指定路由中启用该插件:
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review Comment:
   ```suggestion
   curl http://127.0.0.1:9080/apisix/admin/routes/1  \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   ```



##########
docs/zh/latest/plugins/error-log-logger.md:
##########
@@ -134,3 +124,16 @@ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/error-log-logger -H 'X-A
   }
 }'
 ```
+
+## 禁用插件
+
+当你不在需要该插件是,只需要在 `./conf/config.yaml` 中删除或注释该插件即可。

Review Comment:
   ```suggestion
   当你不再需要该插件时,只需要在 `./conf/config.yaml` 中删除或注释该插件即可。
   ```



##########
docs/zh/latest/plugins/log-rotate.md:
##########
@@ -1,5 +1,11 @@
 ---
 title: log-rotate
+keywords:
+  - APISIX
+  - API 网关
+  - Plugin
+  - 日志切分
+description: 云原生 API 网关 Apache APISIX log-rotate 插件用于定期在日志目录下的访问日志和错误日志的定期切分。

Review Comment:
   ```suggestion
   description: 云原生 API 网关 Apache APISIX log-rotate 插件用于将日志目录下的访问日志和错误日志进行定期切分。
   ```



##########
docs/zh/latest/plugins/udp-logger.md:
##########
@@ -1,5 +1,11 @@
 ---
 title: udp-logger
+keywords:
+  - APISIX
+  - API 网关
+  - Plugin
+  - UDP Logger
+description: 本文介绍了 API 网关 Apache APISIX 如何使用 udp-logger 插件将日志数据发送到 TCP 服务器。

Review Comment:
   ```suggestion
   description: 本文介绍了 API 网关 Apache APISIX 如何使用 udp-logger 插件将日志数据发送到 UDP 服务器。
   ```



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

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