Audit logs record database operations on your ApsaraDB for MongoDB instance. Use the Mongo audit log center in the ApsaraDB for MongoDB console to query these logs.
Prerequisites
Before you begin, ensure that you have:
An ApsaraDB for MongoDB instance with audit logging enabled (free trial edition activated before January 6, 2022)
Starting January 6, 2022, the pay-as-you-go audit log feature launched in all regions and new free trial applications ended. For details, see [Notice] Official launch of the pay-as-you-go audit log feature and end of free trial applications.
View audit logs
The Mongo audit log center displays a maximum of 2,000 log entries. To query more entries, use the Log Service console. For details, see Query and analyze logs.
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based 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
in the Actions column and select Manage.In the left-side navigation pane of the instance details page, choose Data Security > Audit Logs.
On the Mongo audit log center page, query the audit log details. The default time range is the last 15 minutes (relative).
Set the refresh frequency
On the Mongo audit log center page, click Refresh in the upper-right corner to control how often the log view updates.
| Option | Description |
|---|---|
| Once | Immediately refreshes the log view. |
| Auto Refresh | Refreshes automatically every 15 seconds, 60 seconds, 5 minutes, or 15 minutes. |
To stop auto-refresh, choose Refresh > Close, then reconfigure as needed.
Limits
The Mongo audit log center page displays a maximum of 2,000 log entries per query. To access a full log history, use the Log Service console, which provides advanced query and analysis capabilities. For details, see Query and analyze logs.
FAQ
Why do I see only 2,000 log entries?
The Mongo audit log center page displays a maximum of 2,000 entries per query. Log on to the Log Service console to query the full log history. For details, see Query and analyze logs.