All Products
Search
Document Center

Simple Log Service:Enable data collection

Last Updated:Mar 25, 2026

With CloudLens for CLB, you can enable data collection in just a few clicks to collect CLB access logs, Cloud Config logs, and CloudMonitor events. This topic describes how to enable data collection and perform related tasks.

Prerequisites

Configure permissions

Important

You only need to configure permissions the first time. If you have already done so, skip these steps.

  1. Log on to the Log Service console.
  2. In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.

  3. Follow the on-screen instructions to enable CloudLens for CLB.

    During this process, the system automatically grants CloudLens for CLB the AliyunServiceRoleForSLSAudit service-linked role to collect CLB logs. For more information, see Manage the AliyunServiceRoleForSLSAudit service-linked role.

Enable data collection

CloudLens for CLB collects CLB access logs, Cloud Config logs, and CloudMonitor events. The procedure is similar for all data types. The following steps use access log collection as an example.

  1. Log on to the Log Service console.
  2. In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.

  3. On the Access Management page, on the CLB Instance Access tab, find the target CLB instance and click Enable.

  4. In the Enable Access Logs Collect dialog box, select the destination project and Logstore, and then click Confirm.

    Important
    • We recommend storing logs in the recommended project and Logstore for easier management of your Simple Log Service assets.

    • The first time you enable data collection for Cloud Config logs, the Cloud Config Logs dialog box appears. Click Authorize Now to grant Simple Log Service permission to collect your Cloud Config logs.

Related tasks

After enabling CloudLens for CLB, you can also perform the following tasks on the Access Management page.

Actions

Description

Manage CLB instances

After you enable CloudLens for CLB, CloudLens for CLB displays all CLB instances in the current Alibaba Cloud account.

Click a target CLB instance. You are redirected to the Server Load Balancer (SLB) console. You can view the details of the CLB instance and perform tasks, such as creating a listener. For more information, see CLB instances.

Disable data collection

  • In the Access Logs column, click Disable for the target CLB instance to disable its access log collection.

  • On the Global Logs tab, click Disable in the Cloud Config Logs row to disable Cloud Config data collection.

  • On the Global Logs tab, click Disable in the CloudMonitor Events row to disable CloudMonitor event collection.

Query and analyze logs

Click Access Logs for a target CLB instance to open the corresponding Logstore. In the Logstore, you can view the raw logs and perform queries and analyses. For more information, see Quick start for log query and analysis.

Modify the data retention period

On the Destination Logstore tab, find the target Logstore, click the 修改保存时间 icon, and then change the data retention period.

Upgrade legacy access log collection

If log shipping is enabled for your CLB instance in the SLB console and you then enable data collection in CloudLens for CLB, only access logs are collected by default. Operations such as anomaly detection and metrics collection are not performed. You can click Upgrade. CloudLens for CLB then automatically performs anomaly detection, extracts metrics, and generates assets such as inspection results, a MetricStore, and inspection jobs.