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 permanently removes all log data it contains. This action cannot be undone.
Before deleting a Logstore, verify that you no longer need any of its data. There is no recovery option.
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.
Enable data shipping to send log data from your Logstore to OSS in near real time.
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
SLS charges based on the amount of data stored in a Logstore. Use CloudLens for SLS to check the storage size of an individual Logstore. Review the usage notes before you start. For more information, see Usage notes.
If the storage size is larger than expected, shorten the retention period or enable intelligent tiered storage to move older data to Infrequent Access or archive storage.