All Products
Search
Document Center

Simple Log Service:Enable the log collection feature

Last Updated:Apr 15, 2024

CloudLens for SLS provides the log collection feature. You can use the feature to collect the important logs, detailed logs, job operational logs, billing logs, error logs, metrics, and audit logs of Simple Log Service with a few clicks. This topic describes how to enable the log collection feature. This topic also describes the operations that you can perform after you enable the feature.

Prerequisites

A project is created. For more information, see Create a project.

Authorization

Important

You need to perform this operation only once.

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

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

    When you enable CloudLens for SLS, Simple Log Service automatically authorizes CloudLens for SLS to assume the AliyunServiceRoleForSLSAudit service-linked role to collect important logs, detailed logs, job operational logs, billing logs, error logs, metrics, and audit logs. For more information, see Manage the AliyunServiceRoleForSLSAudit service-linked role.

Procedure

You can use CloudLens for SLS to collect the important logs, detailed logs, job operational logs, billing logs, error logs, metrics, and audit logs of Simple Log Service. The operations that are performed to enable the log collection feature for the preceding logs are similar. In this example, the log collection feature is enabled for detailed logs.

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

  3. On the SLS Cluster Access tab of the Access Management page, find the project and click Enable in the Detailed Logs column of the project.

  4. In the Enable Detailed Logs Collect dialog box, select the project and click Confirm.

What to do next

After you enable CloudLens for SLS, you can perform various operations on the Access Management page. The following table describes the operations.

Operation

Description

Manage projects

After you enable CloudLens for SLS, CloudLens for SLS displays all projects that meet the specified conditions within the current Alibaba Cloud account.

Click the project that you want to manage. Then, you are navigated to the Project Overview page of the project.

Disable log collection

Find the project in which you want to disable the log collection feature and click Disable for required logs.

View reports

Find the project whose reports you want to view, click Query Reports in the Actions column, and then select the required dashboard. Then, you are navigated to the dashboard page. For more information, see View data reports.

Reconfigure indexes

On the Destination Logstore tab, find the Logstore for which you want to reconfigure indexes and click Reset. This way, the indexes are reconfigured to the latest built-in version.

Important

After you reconfigure the indexes, the Logstore uses the latest built-in indexes, and custom indexes are deleted. The new indexes take effect only for new data in the Logstore.