View the error logs of a replica set or sharded cluster instance directly from the ApsaraDB for MongoDB console to diagnose instance issues.
Prerequisites
Before you begin, ensure that you have:
A replica set instance or a sharded cluster instance
Standalone instances appear in the replica set instance list but do not support error log viewing.
Limitations
Error logs are retained for seven days.
Log management is not available in all regions. Log on to the ApsaraDB for MongoDB console to check whether the feature is supported in your region.
View error logs in the console
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.
In the upper-left corner of the page, select the resource group and region where your instance is located.
Click the ID of the instance, or click Manage in the Actions column.
In the left-side navigation pane of the instance details page, choose Logs > Error Logs.
Filter and view error logs based on your instance type:
Replica set instances: Select a node role and a time range.
Sharded cluster instances: Select a mongos or shard node to view its logs.
Node type ID prefix Filter dimensions Mongos node s-Node ID, time range Shard node d-Node ID, node role, time range NoteClick Export to download the error logs to your local computer.