Core Module shenyu-plugin-logging-aliyun-sls
Core Class org.apache.shenyu.plugin.aliyun.sls.LoggingAliYunSlsPlugin
Core Class org.apache.shenyu.plugin.aliyun.sls.client.AliyunSlsLogCollectClient
ShenYu 2.5.0
pom.xml file.<!-- shenyu logging-aliyunsls plugin start --> <dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-logging-aliyun-sls</artifactId> <version>${project.version}</version> </dependency> <!-- shenyu logging-aliyunsls plugin end -->
shenyu-admin --> BasicConfig --> Plugin --> loggingAliyunSls set Status enable.| config-item | type | description | remarks |
|---|---|---|---|
| accessId | String | accessId | must |
| accesskey | String | accesskey | must |
| host | String | host name, example:cn-guangzhou.log.aliyuncs.com | must |
| projectName | String | log project name | optional, default shenyu |
| logStoreName | String | log store name | optional, default shenyu-logstore |
| topic | String | aliyun sls log topic | optional, default shenyu-topic |
| ttlInDay | Integer | ttl times in one day | optional, default 3 |
| shardCount | Integer | aliyun sls log shard count | optional, default 10 |
| sendThreadCount | Integer | send log to aliyun sls thread number | optional, default 1 |
| ioThreadCount | Integer | io thread count | optional, default 1 |
| sampleRate | String | sample consume rate | optional, default 1 |
| maxRequestBody | Integer | max request body | optional, default 524288 |
| maxResponseBody | Integer | max response body | optional, default 524288 |
| bufferQueueSize | Integer | consume log queue size | optional, default 50000 |
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 --> loggingAliyunSls set Status disable.