Queries the logs of a container.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeContainerLog |
The operation that you want to perform. Set the value to DescribeContainerLog. |
RegionId | String | No | cn-hangzhou |
The ID of the region where the elastic container instance is deployed. |
ContainerGroupId | String | Yes | eci-uf6fonnghi50v6nq**** |
The ID of the elastic container instance. |
ContainerName | String | Yes | nginx |
The name of the container. |
StartTime | String | No | 2018-08-02T15:00:00Z |
The beginning of the time range to query. Specify the time in the RFC 3339 standard. The time must be in UTC. |
Tail | Integer | No | 500 |
The number of log entries that you want to query. Default value: 500. Maximum value: 2000. A maximum of 1 MB of logs can be returned. |
LastTime | Boolean | No | false |
Specifies whether to query the previous container if the container exits and restarts. Valid values:
Default value: false. |
SinceSeconds | Integer | No | 10 |
A relative time in seconds before the current time from which to show logs. Example: 10, 20, and 30. |
LimitBytes | Long | Yes | 123798 |
The limit on the total size of logs. |
Timestamps | Boolean | Yes | false |
Specifies whether to return the timestamps of logs. Valid values:
Default value: false. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CA850ADA-****-4AC8-****-5B5990EAB7D0 |
The ID of the request. |
ContainerName | String | nginx |
The name of the container. |
Content | String | null |
The content of the log. |
Examples
Sample requests
https://eci.aliyuncs.com/Action=DescribeContainerLog
&RegionId=cn-hangzhou
&ContainerGroupId=eci-uf6fonnghi50v6nq****
&ContainerName=nginx
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<RequestId>CA850ADA-****-4AC8-****-5B5990EAB7D0</RequestId>
<ContainerName>nginx</ContainerName>
<Content>{}</Content>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CA850ADA-****-4AC8-****-5B5990EAB7D0",
"ContainerName" : "nginx",
"Content" : "{}"
}
Error codes
For a list of error codes, visit the API Error Center.