Queries the logs of a container.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • true: queries the previous container.
  • false: does not query the previous container.

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:

  • true: returns the timestamps of logs.
  • false: does not return the timestamps of logs.

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.


Sample requests

&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK


JSON format

HTTP/1.1 200 OK

  "RequestId" : "CA850ADA-****-4AC8-****-5B5990EAB7D0",
  "ContainerName" : "nginx",
  "Content" : "{}"

Error codes

For a list of error codes, visit the API Error Center.