Log management

Updated at:

Log storage and management

A Logstore is the basic unit for storing and querying logs in Simple Log Service (SLS). A Logstore typically stores one category of log data. Use the console or API to create, read, update, and delete Logstores. After a Logstore is created, write log data to it via API or SDK. To collect logs from Alibaba Cloud Elastic Compute Service (ECS) instances, use Logtail, the log collection service provided by SLS.

Log data loss upon Logstore deletion

Deleting a Logstore causes log data loss. Proceed with caution.

Log retention period

Two SLS features control how long log data is retained:

  • Data Storage and Search & Analysis: Store data permanently or for a fixed period—SLS automatically deletes data when the period expires. To reduce storage costs, enable intelligent tiered storage to move older data to Infrequent Access or archive storage.

  • Data shipping: Once you ship logs to OSS or MaxCompute, those services manage the data lifecycle independently.

Reduce costs when shipping logs to OSS

SLS indexing and analysis features incur costs. If you only need to store logs in OSS—without querying or analyzing them in SLS—follow these steps to reduce costs.

  • Indexing is disabled by default. If you have not enabled indexing and analysis, shorten the Logstore's data retention period to reduce storage costs.

  • Disabling indexing and analysis also disables keyword queries, log analysis, dashboards, and alerting. Proceed with caution.

  • Shorten the Logstore data retention period.

    Data stored in a Logstore incurs charges. Reducing the retention period—for example, to one day—lowers your storage cost.

  • Disable indexing.

    1. Enable data shipping to send log data from your Logstore to OSS in near real time.

    2. On the Query/Analysis page of the Logstore, click Query/Analysis Properties in the upper-right corner and select Disable Indexing from the drop-down menu.

After completing these steps, you pay only a small fee for data storage. For pricing details, see pay-by-feature billing.

View the size of a Logstore

The amount of log data stored in a Logstore is a billing item in SLS. You can use CloudLens for SLS to view the amount of log data stored in an individual Logstore. Before you start, make sure that you have read and understood the usage notes to help you complete the operations smoothly. For more information, see Usage notes.