All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeErrorLogRecords

Last Updated:Nov 06, 2023

Queries entries in error logs of an ApsaraDB for MongoDB instance.

Operation Description

  • This operation is applicable only to general-purpose local-disk and dedicated local-disk instances.
  • You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see Manage a Logstore.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dds:DescribeErrorLogRecordsREAD
  • dbinstance
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

Note If you set this parameter to the ID of a sharded cluster instance, you must also specify the NodeId parameter.
dds-bp12c5b040dc****
NodeIdstringNo

The ID of the mongos node or shard node whose error logs you want to query in the instance. If the instance is a sharded cluster instance, you must specify this parameter.

Note This parameter is valid only when DBInstanceId is set to the ID of a sharded cluster instance.
d-bp128a003436****
RoleTypestringNo

The role of the node whose error logs you want to query in the instance. Valid values:

  • primary
  • secondary
Note If you set the NodeId parameter to the ID of a mongos node, the RoleType parameter must be set to primary.
primary
StartTimestringYes

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

2019-01-01T12:10Z
EndTimestringYes

The end of the time range to query. The end time must be later than the start time and within 24 hours from the start time. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2019-01-02T12:10Z
DBNamestringNo

The name of the database.

mongodbtest
PageSizeintegerNo

The number of entries to return on each page. Valid values: 30 to 100.

30
PageNumberintegerNo

The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.

1
ResourceGroupIdstringNo

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

rg-acfmyiu4ekp****

Response parameters

ParameterTypeDescriptionExample
object
TotalRecordCountinteger

The total number of entries.

1
PageRecordCountinteger

The number of entries returned per page.

1
RequestIdstring

The ID of the request.

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

The page number of the returned page.

1
Itemsobject []

Details about the log entries returned.

ConnInfostring

The connection information of the log entry.

conn18xxxxxx
CreateTimestring

The time when the log entry was generated. The time is in the yyyy-MM-ddTHH:mm:ss**Z format. The time is displayed in UTC.

2019-02-26T12:09:34Z
Categorystring

The category of the log entry. Valid values:

  • NETWORK: network connection log
  • ACCESS: access control log
  • -: general log
  • COMMAND: slow query log
  • SHARDING: sharded cluster log
  • STORAGE: storage engine log
  • CONNPOOL: connection pool log
  • ASIO: asynchronous I/O operation log
  • WRITE: slow update log
NETWORK
Contentstring

The content of the log entry.

xxxxxxxx
Idinteger

The ID of the log entry.

1111111111
Enginestring

The database engine.

MongoDB

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidParameterCombinationThe end time must be greater than the start timeThe start time must be earlier than the end time.
400InvalidStartTime.MalformedThe Specified parameter StartTime is not valid.-
400InvalidEndTime.MalformedThe Specified parameter EndTime is not valid.-
403LogApiFrequencyExceededExceeding the allowed frequency of log api.Maximum number of log API operations exceeded.

For a list of error codes, visit the Service error codes.