Official audit logs are billed on a pay-as-you-go basis based on the storage usage and log retention period. If you want to modify the log retention period for all ApsaraDB for MongoDB instances in your Alibaba Cloud account that reside in the same region, you can use the ApsaraDB for MongoDB console. This topic describes how to modify the log retention period.

Precautions

  • The specified retention period is valid for all instances in the region of the current instance. We recommend that you evaluate the retention period of audit logs for all instances in the same region before you set the parameter.
  • Audit logs are billed on a pay-as-you-go basis based on the storage usage and log retention period. To prevent high costs, we recommend that you set the shortest period that meets your business requirements.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
  4. Click the ID of an instance, or click More icon in the Actions column corresponding to the instance 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, modify the log retention period.
    Important
    • The specified retention period is valid for all instances in the region of the current instance. We recommend that you evaluate the retention period of audit logs for all instances in the same region before you set the parameter.
    • Audit logs are billed on a pay-as-you-go basis based on the storage usage and log retention period. To prevent high costs, we recommend that you set the shortest period that meets your business requirements.
  8. Click OK.

Related API operations

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