- How does Log Service store and manage logs?
- Are logs lost after I delete a Logstore?
- What is the log storage period of Log Service? Can I modify this period?
- How to save logs in OSS, and reduce the cost of Log Service?
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.
Deleting a Logstore results in the loss of log data, so proceed with caution.
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.
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.
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.
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.
Activate Shipping logs to OSS function to ship the logs to OSS for saving in real time.
Enter the Logstore list page, and click Query.
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.