In Log Service, a Logstore is used to collect, store, and query data. 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, 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 a Logstore is created, you cannot modify the name of the Logstore.
    WebTracking The switch that controls whether to enable the web tracking feature. After you turn on WebTracking, you can collect data from HTML, HTML5, iOS, or Android platforms and send the data to Log Service.
    Data Retention Period The period of time for which you want to retain the log records in the Logstore. Valid values: 1 to 3000. Unit: days. Log records that are stored for longer than the specified data retention period are automatically deleted.
    Note After you shorten the data retention period, Log Service deletes all log records that are stored for longer than the new retention period from the Logstore within 1 hour. However, the data volume that is displayed on the Storage Size(Log) card on the homepage of the Log Service console is updated the next day. For example, after you change the data retention period from five days to one day, Log Service starts to delete the log records of the previous four days after 1 hour.
    Shards The number of shards in the Logstore. Shards are used to read and write data in Log Service. Each shard can run up to 500 operations to write up to 5 MB of data per second and can run up to 100 operations to read up to 10 MB of data per second. You can create up to 10 shards for each Logstore and up to 200 shards for each project. For more information, see Shard.
    Automatic Sharding The switch that controls whether to enable the automatic sharding feature. If you turn on Automatic Sharding and the read or write speed does not meet your business requirements, Log Service increases the number of shards in the Logstore. For more information, see Manage shards.
    Maximum Shards The number of shards into which the shards that you configure can be split. If you turn on Automatic Sharding, you must set the Maximum Shards parameter. The maximum value of this parameter is 64.
    Log Public IP The switch that controls whether to log the following information. If you turn on Log Public IP, Log Service adds the following information to the Tag field of each log record.
    • __client_ip__: the public IP address of the device from which the log record is collected.
    • __receive_time__: the time when Log Service receives the log record. The time follows the UNIX time format and indicates the number of seconds that have elapsed since 00:00:00 UTC Thursday, January 1, 1970.
  5. Click OK.

Modify a Logstore

  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to modify, click Modify a Logstore, and then select Modify from the menu that is displayed.
  2. On the Logstore Attributes page, click Modify.
    For more information about the attributes of a Logstore, see the "Create a Logstore" section of this topic.
  3. Click Save.

Delete a Logstore

Notice
  • Before you can delete a Logstore, you must delete all Logtail configurations of the Logstore.
  • If the LogShipper feature is enabled for a Logstore, we recommend that you stop data writes to the Logstore and make sure that all log data in the Logstore is shipped before you delete the Logstore.
  • If your Alibaba Cloud account does not have the permissions to delete a Logstore, you can submit a ticket.
  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to delete, click Modify a Logstore, and then select Delete from the menu that is displayed.
    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.

Related operations

Action API operation
Create a Logstore. CreateLogstore
Delete a Logstore. DeleteLogstore
Query one or all Logstores.
  • To query a specified Logstore, call the GetLogstore API operation.
  • To query all Logstores, call the ListLogstore API operation.
Modify a Logstore. UpdateLogstore