Skip to content

Commit 2f3bd9f

Browse files
authored
docs: refactor the docs associated with Logger (#6415)
1 parent fdad0ae commit 2f3bd9f

18 files changed

+136
-160
lines changed

docs/en/latest/batch-processor.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ than 1 will start aggregating the entries until it reaches the max size or the t
3030
The only mandatory parameter to create a batch processor is a function. The function will be executed when the batch reaches the max size
3131
or when the buffer duration exceeds.
3232

33-
|Name |Requirement |Description|
34-
|------- |----- |------|
35-
|name |optional |A unique identifier to identity the batch processor|
36-
|batch_max_size |optional |Max size of each batch, default is 1000|
37-
|inactive_timeout|optional |maximum age in seconds when the buffer will be flushed if inactive, default is 5s|
38-
|buffer_duration|optional |Maximum age in seconds of the oldest entry in a batch before the batch must be processed, default is 5|
39-
|max_retry_count|optional |Maximum number of retries before removing from the processing pipe line; default is zero|
40-
|retry_delay |optional |Number of seconds the process execution should be delayed if the execution fails; default is 1|
33+
| Name | Type | Requirement | Default | Valid | Description |
34+
| ---------------- | ------- | ----------- | ------- | ------- | ------------------------------------------------------------ |
35+
| name | string | optional | logger's name | ["http logger",...] | A unique identifier used to identify the batch processor, which defaults to the name of the logger plug-in that calls the batch processor, such as plug-in "http logger" 's `name` is "http logger. |
36+
| batch_max_size | integer | optional | 1000 | [1,...] | Sets the maximum number of logs sent in each batch. When the number of logs reaches the set maximum, all logs will be automatically pushed to the HTTP/HTTPS service. |
37+
| inactive_timeout | integer | optional | 5 | [1,...] | The maximum time to refresh the buffer (in seconds). When the maximum refresh time is reached, all logs will be automatically pushed to the HTTP/HTTPS service regardless of whether the number of logs in the buffer reaches the maximum number set. |
38+
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed. |
39+
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing the entry from the processing pipeline when an error occurs. |
40+
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
4141

4242
The following code shows an example of how to use batch processor in your plugin:
4343

docs/en/latest/plugins/error-log-logger.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ title: error-log-logger
2323

2424
## Summary
2525

26-
- [**Name**](#name)
27-
- [**Attributes**](#attributes)
28-
- [**How To Enable And Disable**](#how-to-enable-and-disable)
29-
- [**How to set the TCP server address**](#how-to-set-the-tcp-server-address)
26+
- [Summary](#summary)
27+
- [Name](#name)
28+
- [Attributes](#attributes)
29+
- [How To Enable And Disable](#how-to-enable-and-disable)
30+
- [Enable plugin](#enable-plugin)
31+
- [Disable plugin](#disable-plugin)
32+
- [How to set the TCP server address](#how-to-set-the-tcp-server-address)
33+
- [How to set the SkyWalking OAP server address](#how-to-set-the-skywalking-oap-server-address)
3034

3135
## Name
3236

@@ -62,11 +66,8 @@ For more info on Batch-Processor in Apache APISIX please refer.
6266
| timeout | integer | optional | 3 | [1,...] | Timeout for the upstream to connect and send, unit: second. |
6367
| keepalive | integer | optional | 30 | [1,...] | Time for keeping the cosocket alive, unit: second. |
6468
| level | string | optional | WARN | | The filter's log level, default warn, choose the level in ["STDERR", "EMERG", "ALERT", "CRIT", "ERR", "ERROR", "WARN", "NOTICE", "INFO", "DEBUG"], the value ERR equals ERROR. |
65-
| batch_max_size | integer | optional | 1000 | [1,...] | Max size of each batch. |
66-
| inactive_timeout | integer | optional | 3 | [1,...] | Maximum age in seconds when the buffer will be flushed if inactive. |
67-
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed. |
68-
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line. |
69-
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
69+
70+
The plugin supports the use of batch processors to aggregate and process entries(logs/data) in a batch. This avoids frequent data submissions by the plugin, which by default the batch processor submits data every `5` seconds or when the data in the queue reaches `1000`. For information or custom batch processor parameter settings, see [Batch-Processor](../batch-processor.md#configuration) configuration section.
7071

7172
## How To Enable And Disable
7273

docs/en/latest/plugins/http-logger.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ title: http-logger
2323

2424
## Summary
2525

26-
- [**Name**](#name)
27-
- [**Attributes**](#attributes)
28-
- [**How To Enable**](#how-to-enable)
29-
- [**Test Plugin**](#test-plugin)
30-
- [**Metadata**](#metadata)
31-
- [**Disable Plugin**](#disable-plugin)
26+
- [Summary](#summary)
27+
- [Name](#name)
28+
- [Attributes](#attributes)
29+
- [How To Enable](#how-to-enable)
30+
- [Test Plugin](#test-plugin)
31+
- [Metadata](#metadata)
32+
- [Example](#example)
33+
- [Disable Plugin](#disable-plugin)
3234

3335
## Name
3436

@@ -44,17 +46,14 @@ This will provide the ability to send Log data requests as JSON objects to Monit
4446
| auth_header | string | optional | "" | | Any authorization headers. |
4547
| timeout | integer | optional | 3 | [1,...] | Time to keep the connection alive after sending a request. |
4648
| name | string | optional | "http logger" | | A unique identifier to identity the logger. |
47-
| batch_max_size | integer | optional | 1000 | [1,...] | Set the maximum number of logs sent in each batch. When the number of logs reaches the set maximum, all logs will be automatically pushed to the `HTTP/HTTPS` service. |
48-
| inactive_timeout | integer | optional | 5 | [1,...] | The maximum time to refresh the buffer (in seconds). When the maximum refresh time is reached, all logs will be automatically pushed to the `HTTP/HTTPS` service regardless of whether the number of logs in the buffer reaches the maximum number set. |
49-
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed.|
50-
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line. |
51-
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
52-
| include_req_body | boolean | optional | false | [false, true] | Whether to include the request body. false: indicates that the requested body is not included; true: indicates that the requested body is included. Note: if the request body is too big to be kept in the memory, it can't be logged due to Nginx's limitation. |
49+
| include_req_body | boolean | optional | false | [false, true] | Whether to include the request body. false: indicates that the requested body is not included; true: indicates that the requested body is included. Note: if the request body is too big to be kept in the memory, it can't be logged due to Nginx's limitation. |
5350
| include_resp_body| boolean | optional | false | [false, true] | Whether to include the response body. The response body is included if and only if it is `true`. |
5451
| include_resp_body_expr | array | optional | | | When `include_resp_body` is true, control the behavior based on the result of the [lua-resty-expr](https://github.com/api7/lua-resty-expr) expression. If present, only log the response body when the result is true. |
5552
| concat_method | string | optional | "json" | ["json", "new_line"] | Enum type: `json` and `new_line`. **json**: use `json.encode` for all pending logs. **new_line**: use `json.encode` for each pending log and concat them with "\n" line. |
5653
| ssl_verify | boolean | optional | false | [false, true] | Whether to verify certificate. |
5754

55+
The plugin supports the use of batch processors to aggregate and process entries(logs/data) in a batch. This avoids frequent data submissions by the plugin, which by default the batch processor submits data every `5` seconds or when the data in the queue reaches `1000`. For information or custom batch processor parameter settings, see [Batch-Processor](../batch-processor.md#configuration) configuration section.
56+
5857
## How To Enable
5958

6059
The following is an example of how to enable the `http-logger` for a specific route. You could generate a mock HTTP server at [mockbin](http://mockbin.org/bin/create) to view the logs.

docs/en/latest/plugins/kafka-logger.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ title: kafka-logger
2323

2424
## Summary
2525

26-
- [**Name**](#name)
27-
- [**Attributes**](#attributes)
28-
- [**Info**](#info)
29-
- [**How To Enable**](#how-to-enable)
30-
- [**Test Plugin**](#test-plugin)
31-
- [**Disable Plugin**](#disable-plugin)
26+
- [Summary](#summary)
27+
- [Name](#name)
28+
- [Attributes](#attributes)
29+
- [examples of meta_format](#examples-of-meta_format)
30+
- [Info](#info)
31+
- [Sample broker list](#sample-broker-list)
32+
- [How To Enable](#how-to-enable)
33+
- [Test Plugin](#test-plugin)
34+
- [Metadata](#metadata)
35+
- [Example](#example)
36+
- [Disable Plugin](#disable-plugin)
3237

3338
## Name
3439

@@ -51,17 +56,14 @@ For more info on Batch-Processor in Apache APISIX please refer.
5156
| timeout | integer | optional | 3 | [1,...] | Timeout for the upstream to send data. |
5257
| name | string | optional | "kafka logger" | | A unique identifier to identity the batch processor. |
5358
| meta_format | enum | optional | "default" | ["default","origin"] | `default`: collect the request information with default JSON way. `origin`: collect the request information with original HTTP request. [example](#examples-of-meta_format)|
54-
| batch_max_size | integer | optional | 1000 | [1,...] | Set the maximum number of logs sent in each batch. When the number of logs reaches the set maximum, all logs will be automatically pushed to the `Kafka` service. |
55-
| inactive_timeout | integer | optional | 5 | [1,...] | The maximum time to refresh the buffer (in seconds). When the maximum refresh time is reached, all logs will be automatically pushed to the `Kafka` service regardless of whether the number of logs in the buffer reaches the set maximum number. |
56-
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed.|
57-
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line. |
58-
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
5959
| include_req_body | boolean | optional | false | [false, true] | Whether to include the request body. false: indicates that the requested body is not included; true: indicates that the requested body is included. Note: if the request body is too big to be kept in the memory, it can't be logged due to Nginx's limitation. |
6060
| include_req_body_expr | array | optional | | | When `include_req_body` is true, control the behavior based on the result of the [lua-resty-expr](https://github.com/api7/lua-resty-expr) expression. If present, only log the request body when the result is true. |
6161
| include_resp_body| boolean | optional | false | [false, true] | Whether to include the response body. The response body is included if and only if it is `true`. |
6262
| include_resp_body_expr | array | optional | | | When `include_resp_body` is true, control the behavior based on the result of the [lua-resty-expr](https://github.com/api7/lua-resty-expr) expression. If present, only log the response body when the result is true. |
6363
| cluster_name | integer | optional | 1 | [0,...] | the name of the cluster. When there are two or more kafka clusters, you can specify different names. And this only works with async producer_type.|
6464

65+
The plugin supports the use of batch processors to aggregate and process entries(logs/data) in a batch. This avoids frequent data submissions by the plugin, which by default the batch processor submits data every `5` seconds or when the data in the queue reaches `1000`. For information or custom batch processor parameter settings, see [Batch-Processor](../batch-processor.md#configuration) configuration section.
66+
6567
### examples of meta_format
6668

6769
- **default**:

docs/en/latest/plugins/rocketmq-logger.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ title: rocketmq-logger
2323

2424
## Summary
2525

26-
- [**Name**](#name)
27-
- [**Attributes**](#attributes)
28-
- [**Info**](#info)
29-
- [**How To Enable**](#how-to-enable)
30-
- [**Test Plugin**](#test-plugin)
31-
- [**Disable Plugin**](#disable-plugin)
26+
- [Summary](#summary)
27+
- [Name](#name)
28+
- [Attributes](#attributes)
29+
- [examples of meta_format](#examples-of-meta_format)
30+
- [Info](#info)
31+
- [Sample Nameserver list](#sample-nameserver-list)
32+
- [How To Enable](#how-to-enable)
33+
- [Test Plugin](#test-plugin)
34+
- [Metadata](#metadata)
35+
- [Example](#example)
36+
- [Disable Plugin](#disable-plugin)
3237

3338
## Name
3439

@@ -53,16 +58,13 @@ For more info on Batch-Processor in Apache APISIX please refer.
5358
| secret_key | string | optional | "" | | secret key for ACL. |
5459
| name | string | optional | "rocketmq logger" | | A unique identifier to identity the batch processor. |
5560
| meta_format | enum | optional | "default" | ["default","origin"] | `default`: collect the request information with default JSON way. `origin`: collect the request information with original HTTP request. [example](#examples-of-meta_format)|
56-
| batch_max_size | integer | optional | 1000 | [1,...] | Set the maximum number of logs sent in each batch. When the number of logs reaches the set maximum, all logs will be automatically pushed to the `rocketmq` service. |
57-
| inactive_timeout | integer | optional | 5 | [1,...] | The maximum time to refresh the buffer (in seconds). When the maximum refresh time is reached, all logs will be automatically pushed to the `rocketmq` service regardless of whether the number of logs in the buffer reaches the set maximum number. |
58-
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed.|
59-
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line. |
60-
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
6161
| include_req_body | boolean | optional | false | [false, true] | Whether to include the request body. false: indicates that the requested body is not included; true: indicates that the requested body is included. Note: if the request body is too big to be kept in the memory, it can't be logged due to Nginx's limitation. |
6262
| include_req_body_expr | array | optional | | | When `include_req_body` is true, control the behavior based on the result of the [lua-resty-expr](https://github.com/api7/lua-resty-expr) expression. If present, only log the request body when the result is true. |
6363
| include_resp_body| boolean | optional | false | [false, true] | Whether to include the response body. The response body is included if and only if it is `true`. |
6464
| include_resp_body_expr | array | optional | | | When `include_resp_body` is true, control the behavior based on the result of the [lua-resty-expr](https://github.com/api7/lua-resty-expr) expression. If present, only log the response body when the result is true. |
6565

66+
The plugin supports the use of batch processors to aggregate and process entries(logs/data) in a batch. This avoids frequent data submissions by the plugin, which by default the batch processor submits data every `5` seconds or when the data in the queue reaches `1000`. For information or custom batch processor parameter settings, see [Batch-Processor](../batch-processor.md#configuration) configuration section.
67+
6668
### examples of meta_format
6769

6870
- **default**:

0 commit comments

Comments
 (0)