Audit logs are billed on a pay-as-you-go basis based on storage usage and the log retention period. The retention period applies to all instances in the same region — not just the instance you're configuring. Set the shortest period that meets your compliance or business requirements to control costs.
Prerequisites
Before you begin, ensure that you have:
An ApsaraDB for MongoDB instance with audit logging enabled
Access to the ApsaraDB for MongoDB console
Modify the log retention period
Log on to the ApsaraDB for MongoDB console.
In the upper-left corner, select the resource group and region where your instance is located.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on your instance type.
Click the ID of your instance, 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.
In the upper-right corner, click Service Settings.
In the Global Settings section of the Service Settings panel, set the log retention period.
ImportantThis setting applies to all instances in the region — not just the current instance. Evaluate the retention needs of all instances in the region before making changes.
Click OK.
API reference
| Operation | Description |
|---|---|
| ModifyAuditPolicy | Enables or disables audit logging for an ApsaraDB for MongoDB instance, and sets the log retention period. |