Enable log collection

Updated at:

CloudLens for Redis lets you enable log collection with a single click to collect the slow query log, operational log, and audit log from your Tair (Redis OSS-compatible) instances.

Prerequisites

The instance must meet the following requirements:

  • The instance is a Redis Community Edition, Tair (Enterprise Edition) DRAM-based, or Tair (Enterprise Edition) persistent memory-optimized instance.

  • The instance has one of the following architectures:

    • If the deployment mode is Classic (Local Disk-based), all architectures are supported.

    • If the deployment mode is Cloud-native (Cloud Disk-based), only the standard architecture is supported.

Procedure

  1. Log on to the Log Service console.

  2. In the Log Application area, on the Cloud Service Lens tab, click CloudLens for Redis.

  3. When you first enable CloudLens for Redis, you must complete the authorization as prompted.

    • Authorize CloudLens for Redis to use the AliyunServiceRolePolicyForSLSAudit service-linked role to collect logs from Tair (Redis OSS-compatible). For more information, see Manage the AliyunServiceRoleForSLSAudit service-linked role.

    • Authorize Tair (Redis OSS-compatible) to use the AliyunServiceRoleForKvstore service-linked role to access related resources in Log Service. For more information, see service-linked role.

  4. On the Data Import Management page, on the Redis Cluster Access tab, click Enable next to the target Redis instance.

    Important

    When you click Enable, log collection is simultaneously enabled for the audit log, slow query log, and operational log of the Tair (Redis OSS-compatible) instance. You can only disable log collection for the audit log, not for the slow query log or operational log.

  5. In the Enable Audit Log Collection dialog box, set the Retention Period and click Confirm.

    The Retention Period can be set from 1 to 365 days.

Related operations

After you enable CloudLens for Redis, you can perform the following operations on the Data Import Management page.

Actions

Description

Manage Redis instances

After you enable CloudLens for Redis, all eligible Redis instances in your Alibaba Cloud account are displayed.

Click a Redis instance to navigate to the Tair (Redis OSS-compatible) console. You can view instance details and perform operations such as logging on to or migrating a database. For more information, see Manage Redis instances.

Disable log collection

Click Disable next to the target Redis instance to disable log collection for the audit log.

Query and analyze logs

Click Log Search next to the target Redis instance and select a log type. This action redirects you to the corresponding Logstore. You can view the raw logs and perform queries and analysis. For more information, see Quick start for query and analysis.

Next steps

View data reports