title: Logging-Huawei llts日志插件 keywords: [“Logging”] description: logging plugin
Core Module shenyu-plugin-logging-huawei-lts
Core Class org.apache.shenyu.plugin.huawei.lts.LoggingHuaweiLtsPlugin
Core Class org.apache.shenyu.plugin.huawei.lts.client.HuaweiLtsLogCollectClient
ShenYu 2.6.0
<!-- shenyu logging-huaweilts plugin start --> <dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-logging-huawei-lts</artifactId> <version>${project.version}</version> </dependency> <!-- shenyu logging-huaweilts plugin end -->
shenyu-admin
--> BasicConfig --> Plugin --> loggingHuaweiLts
set Status enable.config-item | description | type | remarks |
---|---|---|---|
projectId | The project ID of the HUAWEI CLOUD account(project id) | String | must |
accessKeyId | AK of the HUAWEI CLOUD account | String | must |
accessKeySecret | SK of HUAWEI CLOUD account | String | must |
regionName | Regions of Cloud Log Service | String | must |
logGroupId | The log group ID of the LTS | String | must |
logStreamId | The log stream ID of the LTS | String | must |
totalSizeInBytes | The upper limit of the log size that can be cached by a single producer instance | int | optional |
maxBlockMs | If the producer has insufficient free space, the caller's maximum block time on the send method, in milliseconds. The default is 60 seconds (60000 milliseconds), and 0 seconds is recommended. When the maxBlockMs value >= 0, it will block until the set time. If the blocking time is reached, the memory cannot be obtained, that is, an error will be reported and the log will be discarded. When the value of maxBlockMs=-1, it will be blocked until the sending is successful, and the log will not be discarded | long | optional |
ioThreadCount | The thread pool size for executing log sending tasks | int | optional |
batchSizeThresholdInBytes | When the cached log size in a ProducerBatch is greater than or equal to batchSizeThresholdInBytes, the batch will be sent | int | optional |
batchCountThreshold | When the number of cached logs in a ProducerBatch is greater than or equal to batchCountThreshold, the batch will be sent | int | optional |
lingerMs | The lingering time of a ProducerBatch from creation until it is sendable | int | optional |
retries | If a ProducerBatch fails to send for the first time, the number of times it can be retried is recommended to be 3 times. If retries is less than or equal to 0, the ProducerBatch will directly enter the failure queue after the first sending failure | int | optional |
baseRetryBackoffMs | The backoff time for the first retry | long | optional |
maxRetryBackoffMs | Maximum backoff time for retries | long | optional |
giveUpExtraLongSingleLog | For logs exceeding 1M, the data larger than 1M will be discarded after splitting | boolean | optional |
enableLocalTest | 是否开启跨云上报日志 | boolean | optional |
regionName
区域名称 | RegionName |
---|---|
华北-北京二 | cn-north-2 |
华北-北京四 | cn-north-4 |
华北-北京一 | cn-north-1 |
华东-上海二 | cn-east-2 |
华东-上海一 | cn-east-3 |
华南-广州 | cn-south-1 |
华南-深圳 | cn-south-2 |
西南-贵阳一 | cn-southwest-2 |
projectId
accessKeyId
and accessKeySecret
logGroupId
and logStreamId
collect request info as follows
Field Name | Meaning | Description | Remarks |
---|---|---|---|
clientIp | Client IP | ||
timeLocal | Request time string, format: yyyy-MM-dd HH:mm:ss.SSS | ||
method | request method (different rpc type is not the same, http class for: get, post wait, rpc class for the interface name) | ||
requestHeader | Request header (json format) | ||
responseHeader | Response header (json format) | ||
queryParams | Request query parameters | ||
requestBody | Request Body (body of binary type will not be captured) | ||
requestUri | Request uri | ||
responseBody | Response body | ||
responseContentLength | Response body size | ||
rpcType | rpc type | ||
status | response status | ||
upstreamIp | Upstream (program providing the service) IP | ||
upstreamResponseTime | Time taken by the upstream (program providing the service) to respond to the request (ms ms) | ||
userAgent | Requested user agent | ||
host | The requested host | ||
module | Requested modules | ||
path | The requested path | ||
traceId | Requested Link Tracking ID | Need to access link tracking plugins, such as skywalking,zipkin |
shenyu-admin
--> BasicConfig --> Plugin -->loggingHuaweiLts
set Status disable.