edit-icon download-icon

Log management

Last Updated: May 23, 2018

Question list

  1. How does Log Service store and manage logs?
  2. Are logs lost after I delete a Logstore?
  3. What is the log storage period of Log Service? Can I modify this period?
  4. How to save logs in OSS, and reduce the cost of Log Service?

1. How does Log Service store and manage logs?

The Logstore is the basic unit for storing and querying logs in Log Service. Generally, a Logstore is used to store a specific type of logs. Currently, you can add, delete, modify, and query the Logstores in the console or by using APIs. You can write logs to a created Logstore by using APIs/SDKs. To collect logs from Alibaba Cloud Elastic Compute Service (ECS) instances, you can use Logtail, a log collection service provided by Log Service.

2. Are logs lost after I delete a Logstore?

Deleting a Logstore results in the loss of log data, so proceed with caution.

3. What is the log storage period of Log Service? Can I modify this period?

The following three functions of Log Service are related to the logs storage period:

  • LogHub and LogSearch/Analytics: Configure the log storage period as needed.
  • LogShipper: After shipping logs to Object Storage Service (OSS), configure the log storage period in OSS.

4. How to save logs in OSS, and reduce the cost of Log Service?

The index analysis of Log Service provides powerful functions. However, usage of this feature can generate certain cost. If you want to save logs in OSS, without need for customized log query and analysis, you can reduce the cost in the following way.

Precautions

  • Indexes are disabled by default. If you have not enabled the index analysis function, modify Logstore data storage time to reduce the cost.

  • Disabling the index analysis function can make log keyword query, log statistical analysis, Dashboard, and alarm features unavailable, so proceed with caution.

Cost saving method

  • Modify Logstore data storage time.

    See Manage a Logstore to set Logstore data storage time to one day. Log Service also charges the amount of stored data. You can decrease the storage time to reduce the consumption.

  • Disable the index analysis function.

    1. Activate Shipping logs to OSS function to ship the logs to OSS for saving in real time.

    2. Enter the Logstore list page, and click Query.

    3. Delete the indexes to disable the index analysis function.

After you complete the preceding steps, Log Service only charges the usage of LogHub function. For more information, see Billing method.

Thank you! We've received your feedback.