You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|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. |
41
41
42
42
The following code shows an example of how to use batch processor in your plugin:
Copy file name to clipboardExpand all lines: docs/en/latest/plugins/error-log-logger.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,14 @@ title: error-log-logger
23
23
24
24
## Summary
25
25
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)
30
34
31
35
## Name
32
36
@@ -62,11 +66,8 @@ For more info on Batch-Processor in Apache APISIX please refer.
62
66
| timeout | integer | optional | 3 |[1,...]| Timeout for the upstream to connect and send, unit: second. |
63
67
| keepalive | integer | optional | 30 |[1,...]| Time for keeping the cosocket alive, unit: second. |
64
68
| 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.
| timeout | integer | optional | 3 |[1,...]| Time to keep the connection alive after sending a request. |
46
48
| 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. |
53
50
| 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`. |
54
51
| 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. |
55
52
| 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. |
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
+
58
57
## How To Enable
59
58
60
59
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.
Copy file name to clipboardExpand all lines: docs/en/latest/plugins/kafka-logger.md
+13-11
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,17 @@ title: kafka-logger
23
23
24
24
## Summary
25
25
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)
32
37
33
38
## Name
34
39
@@ -51,17 +56,14 @@ For more info on Batch-Processor in Apache APISIX please refer.
51
56
| timeout | integer | optional | 3 |[1,...]| Timeout for the upstream to send data. |
52
57
| name | string | optional | "kafka logger" || A unique identifier to identity the batch processor. |
53
58
| 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. |
59
59
| 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. |
60
60
| 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. |
61
61
| 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`. |
62
62
| 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. |
63
63
| 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.|
64
64
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.
| name | string | optional | "rocketmq logger" || A unique identifier to identity the batch processor. |
55
60
| 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. |
61
61
| 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. |
62
62
| 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. |
63
63
| 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`. |
64
64
| 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. |
65
65
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.
0 commit comments