All Products
Search
Document Center

ApsaraDB for MongoDB:Modify the retention period for audit logs

Last Updated:Mar 28, 2026

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:

Modify the log retention period

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the upper-left corner, select the resource group and region where your instance is located.

  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on your instance type.

  4. Click the ID of your instance, or click More icon in the Actions column and select Manage.

  5. In the left-side navigation pane of the instance details page, choose Data Security > Audit Logs.

  6. In the upper-right corner, click Service Settings.

  7. In the Global Settings section of the Service Settings panel, set the log retention period.

    Important

    This 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.

  8. Click OK.

API reference

OperationDescription
ModifyAuditPolicyEnables or disables audit logging for an ApsaraDB for MongoDB instance, and sets the log retention period.