Log Service allows you to use Logstores to collect, store, and query logs. This topic describes how to create, modify, and delete a Logstore in the Log Service console.

Create a Logstore

Note You can create up to 200 Logstores for each project.
  1. Log on to the Log Service console.
  2. In the Projects section, click the name of the project that you want to view.
  3. Choose Log Storage > Logstores. On the Logstores tab, click the + icon.
  4. In the Create Logstore panel, set the parameters. The following table describes the parameters.
    Parameter Description
    Logstore Name The name of the Logstore. The name must be unique in the project to which the Logstore belongs. After the Logstore is created, you cannot modify the name.
    WebTracking If you turn on WebTracking, you can collect data from HTML, HTML5, iOS, or Android platforms and send the data to Log Service by using the web tracking feature.
    Data Retention Period The retention period of the logs in the Logstore. Valid values: 1 to 3000. Unit: days. Logs whose retention period exceeds the value of this parameter are automatically deleted.
    Note If you shorten the data retention period, the update takes effect after 1 hour. Then, Log Service deletes data based on the new retention period. The volume of data that is displayed on the Storage Size(Log) card on the homepage of the Log Service console is updated the next day. For example, if you change the value of the Data Retention Period parameter from 5 to 1, Log Service deletes the logs of the previous four days 1 hour after the change.
    Shards Log Service provides shards to read and write data. Each shard supports a write speed of 5 MB/s, 500 write operations per second, a read speed of 10 MB/s, and 100 read operations per second. You can create up to 10 shards for each Logstore. You can create up to 200 shards for each project. For more information, see Shard.
    Automatic Sharding If you turn on Automatic Sharding and the read or write speed does not meet your requirements, Log Service increases the number of shards. For more information, see Manage shards.
    Maximum Shards If you turn on Automatic Sharding, you must set the Maximum Shards parameter. The maximum number of shards is 64.
    Log Public IP If you turn on Log Public IP, Log Service adds the following information to the Tag field of the collected logs.
    • __client_ip__: the public IP address of the log source.
    • __receive_time__: the time when Log Service receives the log. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 UTC, Thursday, January 1, 1970.
  5. Click OK.

Modify the configurations of a Logstore

  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to modify and choose Modify a Logstore > Modify.
  2. On the Logstore Attributes page, click Modify.
    For more information about the parameters, see Create a Logstore.
  3. Click Save.

Delete a Logstore

  • Before you delete a Logstore, you must delete all Logtail configurations of the Logstore.
  • If the log shipping feature is enabled for the Logstore, we recommend that you stop writing data to the Logstore and make sure that all data in the Logstore is shipped before you delete the Logstore.
  • If you are not authorized to delete a Logstore by using your Alibaba Cloud account, submit a ticket to delete the Logstore.
  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to delete and choose Modify a Logstore > Delete.
    Warning After you delete a Logstore, all log data in the Logstore is deleted and cannot be restored. Proceed with caution.
  2. In the Delete dialog box, click OK.

Enable hot and cold-tiered storage for a Logstore

You can enable the hot and cold-tiered storage feature for a Logstore on the Logstore Attributes page of the Logstore in the Log Service console. For more information, see Enable hot and cold-tiered storage for a Logstore.

Logstore-related API operations

Action Operation
Create a Logstore CreateLogstore
Delete a Logstore DeleteLogstore
Query a Logstore
Modify a Logstore UpdateLogstore