All Products
Search
Document Center

Elastic Container Instance:DescribeContainerLog

Last Updated:Jul 28, 2025

Queries the logs of a container in a container group.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eci:DescribeContainerLog

get

*containergroup

acs:eci:{#regionId}:{#accountId}:containergroup/{#containergroupId}

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.
A maximum of 1 MB log data can be returned.

500

LastTime

boolean

No

Specifies whether to query the logs of the previous container if the container exits and restarts. Valid values:

  • true

  • false

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:

  • true

  • false

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.