A Logstore in Log Service is a unit that is used 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 in 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. On the Log Storage > Logstores tab, click the + icon.
  4. In the Create Logstore panel, configure the following 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 change its name.
    WebTracking If you turn on WebTracking, you can collect data from HTML, HTML5, iOS, or Android platforms to Log Service by using the web tracking feature. For more information, see Use web tracking to collect logs.
    Permanent Storage If you turn on Permanent Storage, Log Service permanently stores the collected logs.
    Note You can call an API operation to query the data retention period. If the value is 3650, the logs are permanently stored.
    Data Retention Period The retention period of logs in the Logstore. Valid values: 1 to 3000. Unit: days. When logs are stored for a period that exceeds the value of this parameter, the logs are automatically deleted.

    You can configure the Data Retention Period parameter only if you do not turn on Permanent Storage.

    Note If you shorten the data retention period, Log Service deletes all expired logs within 1 hour. The data volume that is displayed for Storage Size(Log) 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 within 1 hour.
    Shards The number of shards. Log Service provides shards that allow you 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 in each Logstore. You can create up to 200 shards in each project. For more information, see Shard.
    Automatic Sharding If you turn on Automatic Sharding, Log Service increases the number of shards when the existing shards cannot accommodate the data that is written. For more information, see Manage shards.
    Maximum Shards If you turn on Automatic Sharding, you must configure this parameter to specify the maximum number of shards that can be created. Maximum value: 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 value is a UNIX timestamp representing the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
  5. Click OK.

Modify the configurations of a Logstore

  1. On the Log Storage > Logstores tab, find the Logstore whose configurations you want to modify and choose Modify 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 can delete a Logstore, you must delete all Logtail configurations that are associated with 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 contact technical support.
  1. On the Log Storage > Logstores tab, find the Logstore that you want to delete and choose Modify Logstore > Delete.
    Warning After you delete a Logstore, all logs in the Logstore are deleted and cannot be restored. Proceed with caution.
  2. In the Delete message, 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

Operation API operation
Create a Logstore CreateLogStore
Delete a Logstore DeleteLogstore
Query a Logstore
Modify a Logstore UpdateLogstore