All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeErrorLogRecords

Last Updated:Oct 08, 2026

Queries the error logs of a MongoDB instance.

Operation description

  • This operation applies to instances of the General-purpose Local Disk and Dedicated Local Disk specification types.

  • This operation is limited to 30 calls per minute. Exceeding this limit triggers throttling. Do not call this operation at a high frequency. For high-frequency access, use Logstore. For more information, see Manage a Logstore.

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 supports 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

dds:DescribeErrorLogRecords

get

*dbinstance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

Note

If you specify a sharded cluster instance ID for this parameter, you must also specify the NodeId parameter.

dds-bp12c5b040dc****

NodeId

string

No

The ID of a mongos node or shard node in the sharded cluster instance.

Note

This parameter is available only when the DBInstanceId parameter is set to a sharded cluster instance ID.

d-bp128a003436****

RoleType

string

No

The role of the node in the instance. Valid values:

  • primary: primary node.

  • secondary: secondary node.

  • search: search node.

Note

If the NodeId parameter is set to a mongos node ID, this parameter can only be set to primary.

Valid values:

  • secondary :

    Secondary node.

  • search :

    Search node.

  • primary :

    Primary node.

primary

StartTime

string

Yes

The start time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2019-01-01T12:10Z

EndTime

string

Yes

The end time of the query. The end time must be later than the start time, and the interval between the end time and the start time cannot exceed one day. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2019-01-02T12:10Z

DBName

string

No

The name of the database.

mongodbtest

PageSize

integer

No

The number of entries per page. Valid values: 30 to 100.

30

PageNumber

integer

No

The page number. The value must be a positive integer that does not exceed the maximum value of the Integer data type. Default value: 1.

1

ResourceGroupId

string

No

The resource group ID. For more information about resource groups, see View basic information of a resource group.

rg-acfmyiu4ekp****

QueryKeywords

string

No

The keywords to search for. Separate multiple keywords with spaces. You can specify a maximum of 10 keywords.

test test1

LogicalOperator

string

No

The logical operator for keyword search. Default value: and.

Valid values:

  • or :

    Contains any of the keywords.

  • and :

    Contains all keywords.

and

Response elements

Element

Type

Description

Example

object

TotalRecordCount

integer

The total number of records.

1

PageRecordCount

integer

The number of records per page.

1

RequestId

string

The request ID.

68BCBEC2-1E66-471F-A1A8-E3C60C0A80B0

PageNumber

integer

The page number.

1

Items

object

LogRecords

array<object>

The list of error log entries.

object

ConnInfo

string

The connection information of the log.

conn18xxxxxx

CreateTime

string

The time when the log was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is in UTC.

2019-02-26T12:09:34Z

Category

string

The log category. Valid values:

  • NETWORK: network connectivity log.

  • ACCESS: access control logs.

  • -: general log.

  • COMMAND: slow query log.

  • SHARDING: cluster log.

  • STORAGE: DPI engine log.

  • CONNPOOL: connection pool log.

  • ASIO: asynchronous I/O log.

  • WRITE: slow update log.

NETWORK

Content

string

The log content.

xxxxxxxx

Id

integer

The log ID.

1111111111

Engine

string

The engine type of the current database.

MongoDB

Examples

Success response

JSON format

{
  "TotalRecordCount": 1,
  "PageRecordCount": 1,
  "RequestId": "68BCBEC2-1E66-471F-A1A8-E3C60C0A80B0",
  "PageNumber": 1,
  "Items": {
    "LogRecords": [
      {
        "ConnInfo": "conn18xxxxxx",
        "CreateTime": "2019-02-26T12:09:34Z",
        "Category": "NETWORK",
        "Content": "xxxxxxxx",
        "Id": 1111111111
      }
    ]
  },
  "Engine": "MongoDB"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameterCombination The end time must be greater than the start time The start time must be earlier than the end time.
400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid.
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid.
403 LogApiFrequencyExceeded Exceeding the allowed frequency of log api.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.