View the operational logs of an ApsaraDB for MongoDB instance to monitor its running status and troubleshoot issues.
Prerequisites
Before you begin, ensure that:
The instance is a replica set instance or a sharded cluster instance.
Standalone instances are listed under replica set instances but do not support operational logs.
Constraints
Logs are available for the last 7 days only.
The log management feature is unavailable in some regions. Log on to the ApsaraDB for MongoDB console to verify regional availability before proceeding.
View running logs
Log on to the ApsaraDB for MongoDB console.
In the left navigation pane, click Replica Set Instances or Sharded Cluster Instances, depending on your instance type.
In the upper-left corner, select the resource group and region where your instance is located.
Click the instance ID, or click Manage in the Actions column.
In the left navigation pane of the instance details page, click Logs > Running Logs.
Query the logs based on your instance type:
Replica set instance: Select a node role and a time range.
Sharded cluster instance: Select either a Mongos node or a shard node to query.
NoteMongos node IDs are prefixed with
s-. Shard node IDs are prefixed withd-.Mongos node: Select a Mongos node ID and a time range.
Shard node: Select a shard node ID, a node role, and a time range.
To download the displayed logs, click the
icon in the upper-right corner.