Queries the logs of a specified service.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eas:DescribeServiceLog |
get |
*Service
|
None | None |
Request syntax
GET /api/v2/services/{ClusterId}/{ServiceName}/logs HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The ID of the region where the service is deployed. |
cn-shanghai |
| ServiceName |
string |
Yes |
The service name. For more information about how to query the service name, see ListServices. |
echo |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageNum |
integer |
No |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default value: 500. |
500 |
| Ip |
string |
No |
The IP address of the instance to query logs for. For more information about how to query instance IP addresses, see ListServiceInstances. |
10.0.0.1 |
| Keyword |
string |
No |
The keyword used to filter service logs. |
key |
| StartTime |
string |
No |
The beginning of the time range to query. The time must be in Coordinated Universal Time (UTC). |
2006-01-02 15:04:05 |
| EndTime |
string |
No |
The end of the time range to query. The time must be in UTC. |
2006-01-02 15:04:05 |
| InstanceName |
string |
No |
The name of the instance running the service. For more information about how to query instance names, see ListServiceInstances. |
echo-da290ac8-7fckm |
| ContainerName |
string |
No |
The name of the container running the service. |
worker0 |
| Previous |
boolean |
No |
Specifies whether to query logs generated before the instance last restarted. This parameter takes effect only if the instance has restarted. Valid values:
Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
40325405-579C-4D82******** |
| Logs |
array |
The returned logs. |
|
|
string |
The log entry. |
echo_test |
|
| PageNum |
integer |
The page number. |
1 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| TotalPageNum |
integer |
The total number of pages returned. |
500 |
Examples
Success response
JSON format
{
"RequestId": "40325405-579C-4D82********",
"Logs": [
"echo_test"
],
"PageNum": 1,
"TotalCount": 1,
"TotalPageNum": 500
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.