Queries the request logs of a user.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apigateway:QueryRequestLogs |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RequestLogId |
string |
Yes |
The ID of the request log. |
95657ED9-2F6F-426F-BD99-79C8******** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The ID of the request. |
CE5722A6-AE78-4741-A9B0-6C81******** |
| RequestLogs |
object |
||
| RequestLog |
array<object> |
The request logs. |
|
|
object |
The request log. |
||
| ApiId |
string |
The API ID. |
4b83229ebcab4ecd88956fb3******** |
| ApiName |
string |
The API name. |
ApiName |
| ConsumerAppKey |
string |
The App Key that is used by the caller. |
20412**** |
| TotalLatency |
string |
The total time consumed by the request. Unit: milliseconds. |
1345 |
| HttpMethod |
string |
The HTTP method that is used to send the request. |
POST |
| Domain |
string |
The requested domain name in the request. |
360bdd88695c48ae8085c7f2********-ap-southeast-1.alicloudapi.com |
| ErrorMessage |
string |
The error message returned if the call fails. |
Backend service connect failed `Timeout connecting to [/1XX.20.0.XX:8080]` |
| ConsumerAppId |
string |
The application ID that is used by the caller. |
11096**** |
| InstanceId |
string |
The ID of the API Gateway instance to which the API belongs. |
apigateway-bj-ab2b******** |
| ClientNonce |
string |
The X-Ca-Nonce header included in the request from the client. |
d43df9db-3b05-4cd6-888a-1c0b******** |
| RequestSize |
string |
The size of the request. Unit: bytes. |
1923 |
| StageId |
string |
The ID of the API environment. |
8a305b7f10334052a52d9156******** |
| StageName |
string |
The name of the API environment. |
RELEASE |
| HttpPath |
string |
The path of the request. |
/testPath |
| RequestId |
string |
The request ID. |
95657ED9-2F6F-426F-BD99-79C8******** |
| GroupId |
string |
The ID of the API group to which the API belongs. |
dc024277fe6c4cada79ba0bd6******** |
| GroupName |
string |
The name of the API group to which the API belongs. |
GroupName |
| ErrorCode |
string |
The error code that is returned. |
X500ER |
| ResponseSize |
string |
The size of returned data. Unit: bytes. |
23441 |
| Region |
string |
The region in which the instance resides. |
cn-hangzhou |
| StatusCode |
string |
The status code returned. |
200 |
| ClientIp |
string |
The IP address of the client that sends the request. |
21.237.XXX.XXX |
| ServiceLatency |
string |
The total time consumed to access the backend resources. The total time includes the time consumed to request a connection to the resources, the time consumed to establish the connection, and the time consumed to call the backend service. Unit: milliseconds. |
324 |
| RequestTime |
string |
The request time, in UTC. |
2022-10-29T03:59:59Z |
| Exception |
string |
The specific error message returned by the backend service. |
error msg |
| CustomTraceId |
string |
The custom trace ID. |
95657ED9-2F6F-426F-BD99-79C8******** |
| JwtClaims |
string |
The JSON web token (JWT) claims. The claims can be configured at the group level. |
{} |
| RequestProtocol |
string |
The protocol used by the client to send the request. Valid values: HTTP, HTTPS, and WS. |
HTTP |
| RequestHeaders |
string |
The request headers. |
content-type: application/x-www-form-urlencoded |
| RequestQueryString |
string |
The query string for the request. |
username=name |
| RequestBody |
string |
The request body. A request body cannot exceed 1,024 bytes in size. |
param=paramName |
| ResponseHeaders |
string |
The headers in the API response. |
content-type: application/x-www-form-urlencoded |
| ResponseBody |
string |
The response body. A response body cannot exceed 1,024 bytes in size. |
param=paramName |
| plugin |
string |
The plug-in hit by the request and the relevant context. |
[] |
| InitialRequestId |
string |
The initial request ID when API Gateway calls an API. For example, if API-1 calls API-2, the initialRequestId parameter in the log of API-2 indicates the ID of the request from API-1. |
95657ED9-2F6F-426F-BD99-79C8******** |
| AppName |
string |
The application name. |
VIPROOM_VIPROOM |
| FrontRequestStart |
integer |
The time when API Gateway started to receive the request. |
1731487224968 |
| FrontRequestEnd |
integer |
The time when API Gateway finished receiving the request. |
1731487224968 |
| BackendRequestStart |
integer |
The time when API Gateway started to forward the request to the backend service. |
1731487224969 |
| BackendRequestEnd |
integer |
The time when API Gateway finished forwarding the request to the backend service. |
1731487224969 |
| BackendResponseStart |
integer |
The time when API Gateway started to receive the response from the backend service. |
1731487224989 |
| BackendResponseEnd |
integer |
The time when API Gateway finished receiving the response from the backend service. |
1731487224989 |
| FrontResponseStart |
integer |
The time when API Gateway started to forward the response to the client. |
1731487224989 |
| FrontResponseEnd |
integer |
The time when API Gateway finished forwarding the response to the client. |
1731487224989 |
Examples
Success response
JSON format
{
"RequestId": "CE5722A6-AE78-4741-A9B0-6C81********",
"RequestLogs": {
"RequestLog": [
{
"ApiId": "4b83229ebcab4ecd88956fb3********",
"ApiName": "ApiName",
"ConsumerAppKey": "20412****",
"TotalLatency": "1345",
"HttpMethod": "POST",
"Domain": "360bdd88695c48ae8085c7f2********-ap-southeast-1.alicloudapi.com",
"ErrorMessage": "Backend service connect failed `Timeout connecting to [/1XX.20.0.XX:8080]`",
"ConsumerAppId": "11096****",
"InstanceId": "apigateway-bj-ab2b********",
"ClientNonce": "d43df9db-3b05-4cd6-888a-1c0b********",
"RequestSize": "1923",
"StageId": "8a305b7f10334052a52d9156********",
"StageName": "RELEASE",
"HttpPath": "/testPath",
"RequestId": "95657ED9-2F6F-426F-BD99-79C8********",
"GroupId": "dc024277fe6c4cada79ba0bd6********",
"GroupName": "GroupName",
"ErrorCode": "X500ER",
"ResponseSize": "23441",
"Region": "cn-hangzhou",
"StatusCode": "200",
"ClientIp": "21.237.XXX.XXX",
"ServiceLatency": "324",
"RequestTime": "2022-10-29T03:59:59Z",
"Exception": "error msg",
"CustomTraceId": "95657ED9-2F6F-426F-BD99-79C8********",
"JwtClaims": "{}",
"RequestProtocol": "HTTP",
"RequestHeaders": "content-type: application/x-www-form-urlencoded",
"RequestQueryString": "username=name",
"RequestBody": "param=paramName",
"ResponseHeaders": "content-type: application/x-www-form-urlencoded\n",
"ResponseBody": "param=paramName\n",
"plugin": "[]",
"InitialRequestId": "95657ED9-2F6F-426F-BD99-79C8********",
"AppName": "VIPROOM_VIPROOM",
"FrontRequestStart": 1731487224968,
"FrontRequestEnd": 1731487224968,
"BackendRequestStart": 1731487224969,
"BackendRequestEnd": 1731487224969,
"BackendResponseStart": 1731487224989,
"BackendResponseEnd": 1731487224989,
"FrontResponseStart": 1731487224989,
"FrontResponseEnd": 1731487224989
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.