Queries the logs of a container in a container group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eci:DescribeContainerLog |
get |
*containergroup
|
eci:tag
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID of the elastic container instance. |
cn-hangzhou |
| ContainerGroupId |
string |
Yes |
The instance ID. |
eci-uf6fonnghi50v6nq**** |
| ContainerName |
string |
Yes |
The name of the container. |
nginx |
| StartTime |
string |
No |
The beginning of the time range to query. Specify the time in the RFC 3339 standard. The time must be in UTC. |
2018-08-02T15:00:00Z |
| Tail |
integer |
No |
The number of the most recent log entries that you want to query. Default value: 500. Maximum value: 2000. |
500 |
| LastTime |
boolean |
No |
Specifies whether to query the logs of the previous container if the container exits and restarts. Valid values:
Default value: false. |
false |
| SinceSeconds |
integer |
No |
A relative time in seconds before the current time from which to show logs. Examples: 10, 20, and 30. |
10 |
| LimitBytes |
integer |
No |
The limit on the total size of logs. Unit: bytes. Valid values: 1 to 1048576(1 MB). |
123798 |
| Timestamps |
boolean |
No |
Specifies whether to return the timestamps of logs. Valid values:
Default value: false. |
false |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
CA850ADA-****-4AC8-****-5B5990EAB7D0 |
| ContainerName |
string |
The container name. |
nginx |
| Content |
string |
The content of the log. |
{} |
Examples
Success response
JSON format
{
"RequestId": "CA850ADA-****-4AC8-****-5B5990EAB7D0",
"ContainerName": "nginx",
"Content": "{}"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | Forbidden.Unauthorized | You are not authorized to operate on the specified resource. | |
| 408 | Request Timeout | Request timed out, please try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.