mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-15 01:11:58 +08:00
docs(http-logger): Improve the attribute description of the document. (#2891)
close #2879
This commit is contained in:
parent
e66dd9a314
commit
c8e7e0377d
@ -39,17 +39,17 @@ This will provide the ability to send Log data requests as JSON objects to Monit
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ---------------- | ------- | ----------- | ------------- | ------- | ---------------------------------------------------------------------------------------- |
|
||||
| uri | string | required | | | URI of the server |
|
||||
| auth_header | string | optional | "" | | Any authorization headers |
|
||||
| timeout | integer | optional | 3 | [1,...] | Time to keep the connection alive after sending a request |
|
||||
| name | string | optional | "http logger" | | A unique identifier to identity the logger |
|
||||
| batch_max_size | integer | optional | 1000 | [1,...] | Max size of each batch |
|
||||
| inactive_timeout | integer | optional | 5 | [1,...] | Maximum age in seconds when the buffer will be flushed if inactive |
|
||||
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed |
|
||||
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line |
|
||||
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails |
|
||||
| include_req_body | boolean | optional | false | | Whether to include the request body |
|
||||
| concat_method | string | optional | "json" | | 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. |
|
||||
| uri | string | required | | | The URI of the `HTTP/HTTPS` server. |
|
||||
| auth_header | string | optional | "" | | Any authorization headers. |
|
||||
| timeout | integer | optional | 3 | [1,...] | Time to keep the connection alive after sending a request. |
|
||||
| name | string | optional | "http logger" | | A unique identifier to identity the logger. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed.|
|
||||
| max_retry_count | integer | optional | 0 | [0,...] | Maximum number of retries before removing from the processing pipe line. |
|
||||
| retry_delay | integer | optional | 1 | [0,...] | Number of seconds the process execution should be delayed if the execution fails. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
|
||||
## How To Enable
|
||||
|
||||
@ -88,7 +88,7 @@ hello, world
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ---------------- | ------- | ----------- | ------------- | ------- | ---------------------------------------------------------------------------------------- |
|
||||
| log_format | object | optional | | | Log format declared as JSON object. Only string is supported in the `value` part. If the value starts with `$`, the value is [Nginx variable](http://nginx.org/en/docs/varindex.html). |
|
||||
| log_format | object | optional | {"host": "$host", "@timestamp": "$time_iso8601", "client_ip": "$remote_addr"} | | Log format declared as JSON object. Only string is supported in the `value` part. If the value starts with `$`, the value is [Nginx variable](http://nginx.org/en/docs/varindex.html). |
|
||||
|
||||
Note that the metadata configuration is applied in global scope, which means it will take effect on all Route or Service which use http-logger plugin.
|
||||
|
||||
|
@ -38,17 +38,17 @@
|
||||
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| ---------------- | ------- | ------ | ------------- | ------- | ------------------------------------------------ |
|
||||
| uri | string | 必须 | | | 服务器的 URI |
|
||||
| auth_header | string | 可选 | "" | | 授权头部 |
|
||||
| timeout | integer | 可选 | 3 | [1,...] | 发送请求后保持连接活动的时间 |
|
||||
| name | string | 可选 | "http logger" | | 标识 logger 的唯一标识符 |
|
||||
| batch_max_size | integer | 可选 | 1000 | [1,...] | 每批的最大大小 |
|
||||
| inactive_timeout | integer | 可选 | 5 | [1,...] | 刷新缓冲区的最大时间(以秒为单位) |
|
||||
| buffer_duration | integer | 可选 | 60 | [1,...] | 必须先处理批次中最旧条目的最长期限(以秒为单位) |
|
||||
| max_retry_count | integer | 可选 | 0 | [0,...] | 从处理管道中移除之前的最大重试次数 |
|
||||
| retry_delay | integer | 可选 | 1 | [0,...] | 如果执行失败,则应延迟执行流程的秒数 |
|
||||
| include_req_body | boolean | 可选 | | | 是否包括请求 body |
|
||||
| concat_method | string | 可选 | "json" | | 枚举类型,`json`、`new_line`。**json**: 对所有待发日志使用 `json.encode` 编码。**new_line**: 对每一条待发日志单独使用 `json.encode` 编码并使用 "\n" 连接起来。 |
|
||||
| uri | string | 必须 | | | `HTTP/HTTPS` 服务器的 URI。 |
|
||||
| auth_header | string | 可选 | "" | | 授权头部。 |
|
||||
| timeout | integer | 可选 | 3 | [1,...] | 发送请求后保持连接活动的时间。 |
|
||||
| name | string | 可选 | "http logger" | | 标识 logger 的唯一标识符。 |
|
||||
| batch_max_size | integer | 可选 | 1000 | [1,...] | 设置每批发送日志的最大条数,当日志条数达到设置的最大值时,会自动推送全部日志到 `HTTP/HTTPS` 服务。 |
|
||||
| inactive_timeout | integer | 可选 | 5 | [1,...] | 刷新缓冲区的最大时间(以秒为单位),当达到最大的刷新时间时,无论缓冲区中的日志数量是否达到设置的最大条数,也会自动将全部日志推送到 `HTTP/HTTPS` 服务。 |
|
||||
| buffer_duration | integer | 可选 | 60 | [1,...] | 必须先处理批次中最旧条目的最长期限(以秒为单位)。 |
|
||||
| max_retry_count | integer | 可选 | 0 | [0,...] | 从处理管道中移除之前的最大重试次数。 |
|
||||
| retry_delay | integer | 可选 | 1 | [0,...] | 如果执行失败,则应延迟执行流程的秒数。 |
|
||||
| include_req_body | boolean | 可选 | false | [false, true] | 是否包括请求 body。false: 表示不包含请求的 body ; true: 表示包含请求的 body 。 |
|
||||
| concat_method | string | 可选 | "json" | ["json", "new_line"] | 枚举类型: `json`、`new_line`。**json**: 对所有待发日志使用 `json.encode` 编码。**new_line**: 对每一条待发日志单独使用 `json.encode` 编码并使用 "\n" 连接起来。 |
|
||||
|
||||
## 如何开启
|
||||
|
||||
@ -87,7 +87,7 @@ hello, world
|
||||
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| ---------------- | ------- | ------ | ------------- | ------- | ------------------------------------------------ |
|
||||
| log_format | object | 可选 | | | 以 Hash 对象方式声明日志格式。对 value 部分,仅支持字符串。如果是以`$`开头,则表明是要获取 [Nginx 内置变量](http://nginx.org/en/docs/varindex.html)。特别的,该设置是全局生效的,意味着指定 log_format 后,将对所有绑定 http-logger 的 Route 或 Service 生效。 |
|
||||
| log_format | object | 可选 | {"host": "$host", "@timestamp": "$time_iso8601", "client_ip": "$remote_addr"} | | 以 Hash 对象方式声明日志格式。对 value 部分,仅支持字符串。如果是以`$`开头,则表明是要获取 [Nginx 内置变量](http://nginx.org/en/docs/varindex.html)。特别的,该设置是全局生效的,意味着指定 log_format 后,将对所有绑定 http-logger 的 Route 或 Service 生效。 |
|
||||
|
||||
### 设置日志格式示例
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user