How does Log Service store and manage user logs?

A Logstore is the basic unit for storing and querying logs in Log Service. It is generally used to store a type of log data. Currently, you can add, delete, modify, and query Logstores in the Log Service console or by using the API. After a Logstore is created, you can write logs to the Logstore by using the API or SDK. Log Service also provides Logtail to help you easily collect log data from Alibaba Cloud Elastic Compute Service (ECS) instances.

Are logs lost when I delete a Logstore?

If you delete a Logstore, you also delete all the log data stored in the Logstore. Therefore, exercise caution when performing this operation.

How long is log data stored in Log Service? Can I change the data retention period?

The following features of Log Service involve the data retention period of logs:

  • LogHub and LogSearch: You can set the data retention period as required.
  • LogShipper: After logs are shipped to Object Storage Service (OSS) or MaxCompute, you can set the data retention period in OSS or MaxCompute.

How can I reduce the expenditure on Log Service if I want to store logs to OSS?

Log Service charges you certain fees when you use its powerful indexing and analysis features. If you only want to store logs to OSS and do not have any custom requirements for log query and analysis, you can use the following methods to reduce your expenditure on Log Service:

Important notes
  • The indexing feature is disabled by default. If the indexing and analysis features are disabled, you can shorten the data retention period of a Logstore to reduce data storage costs.

  • After you disable the indexing and analysis features, relevant features also become unavailable, such as log query by keyword, log statistical analysis, dashboards, and alerting. Therefore, exercise caution when performing this operation.

  • Change the data retention period of a Logstore.

    You can change the data retention period of a Logstore to one day. Log Service charges certain fees for storing data in a Logstore. Therefore, you can shorten the data retention period to reduce the expenditure.

  • Disable the indexing feature.

    1. Enable the OSS data shipping feature to ship log data from a Logstore to OSS for storage in a quasi-real-time manner.
    2. On the Logstores tab in the left-side navigation pane, click Search & Analysis next to a Logstore.

    3. Delete all indexes and disable the indexing feature.

After the indexing and analysis features are disabled, Log Service charges you only small fees for using LogHub. For more information, see Pay-as-you-go.