All Products
Search
Document Center

Simple Log Service:Manage a Logstore

Last Updated:Sep 30, 2025

A Logstore is a storage unit in Simple Log Service (SLS) that is used to collect, store, and query log data.

Core concepts

What is a Logstore

A Logstore is a data container in Simple Log Service. You can create multiple Logstores in a project to isolate and manage logs from different services or sources.

In addition, some cloud products and SLS features automatically create dedicated Logstores. These Logstores serve specific purposes, and you cannot write other data to them. For example:

Logstore specifications

Simple Log Service offers two Logstore specifications: Standard and Query. They differ in features and cost.

Type

Cost (index traffic fee comparison)

Scenarios

Standard

0.0875 USD per GB

Suitable for scenarios that require data analytics, real-time monitoring, and visualization capabilities, such as interactive analysis, real-time monitoring, or building observability systems.

Query

USD 0.0146 per GB

Does not support analytics. Suitable for archival scenarios such as log archiving, audit log storage, and troubleshooting that require fast retrieval of log content without analysis. Typical applications include long-term storage of large-scale logs with low access frequency.

Scope and permissions

Permissions

  • An Alibaba Cloud account has full access to all Logstore operations by default.

  • By default, a RAM user has no permissions for Logstores. You must request permissions from the Alibaba Cloud account holder, who can then attach one of the following system policies to the RAM user.

    • AliyunLogFullAccess: Grants full permissions to manage SLS.

    • AliyunLogReadOnlyAccess: Grants read-only permissions for SLS.

    If the system policies cannot meet your requirements, you can create custom policies to implement fine-grained permission management. For more information, see the following table.

    Operation

    Required permissions

    Manage a Logstore

    • log:ListProject

    • log:GetAcceleration

    • log:ListDomains

    • log:GetLogging

    • log:ListTagResources

    • log:GetProject

    • log:ListLogStores

    • log:*LogStore

    • log:*Index

    • log:ListShards

    • log:GetLogStoreHistogram

    • log:GetLogStoreContextLogs

    Query a Logstore

    • log:ListProject

    • log:GetAcceleration

    • log:ListDomains

    • log:GetLogging

    • log:ListTagResources

    • log:GetProject

    • log:ListLogStores

    • log:GetLogStore

    • log:GetLogStoreHistogram

    • log:GetIndex

    • log:CreateIndex

    • log:UpdateIndex

    • log:ListShards

    • log:GetLogStoreContextLogs

Create a basic Logstore

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage.

  2. On the Log Storage > Logstores tab, click the + icon.

    image

  3. On the Create Logstore page, configure the parameters and click OK.

    1. Logstore Type: The default value is Standard.

    2. Billing Mode:

      • Pay-as-you-go (cannot be changed): You are billed for each resource that you use, such as storage, indexing, and read/write operations. A monthly free quota is provided to help you control costs in small-scale use cases.

      • Pay-by-ingested-data: You pay only for the raw data that you write. Storage and basic features are free for 30 days. This billing mode has a simpler and more cost-effective structure.

      The pay-by-ingested-data mode is ideal when your data retention period is close to 30 days and you require indexing comparable to a full-text index.
    3. Logstore Name: The name must be unique within the project. It serves as the unique identifier for the Logstore and cannot be changed after the Logstore is created.

    4. Data Retention Period: The default value is 30 days.

    5. Keep the default values for the other parameters. For a full list of parameters, see the following table.

    Full list of Logstore parameters

    Parameter

    Description

    Logstore Type

    SLS Logstores support two specifications: Standard and Query. You can choose one based on your scenario to save costs.

    • The Standard specification includes the complete one-stop data analytics features of SLS. It is suitable for scenarios such as real-time monitoring, interactive analysis, and building complete observability systems.

    • The index traffic unit price for the Query specification is 29% of the Standard specification. This lets you enable indexes for more fields for the same cost. The Query specification supports only keyword search and does not support statistical analysis.

    Billing Mode

    • Pay-as-you-go: This is the original billing mode of SLS. You are billed for the resources that you use, such as storage and indexes, and features, such as data transformation and data shipping. You are charged on a pay-as-you-go basis.

    • Pay-by-ingested-data: This is a simplified billing mode of SLS. You are charged mainly for the amount of raw data that you write to SLS. After data is written to SLS, you can store the data and use features such as data transformation and data shipping for free for 30 days. This billing mode is simple, predictable, and controllable. It helps you make full use of SLS to mine more data value.

    Logstore Name

    The Logstore name must be unique within a project and cannot be changed after creation.

    WebTracking

    Enables the collection of user access data from web browsers and mobile apps (iOS/Android). This feature is disabled by default.

    Data Retention Period

    The number of days to retain log data before it is automatically deleted. Valid values: 1 to 3650. A value of 3650 indicates permanent storage.

    Intelligent Tiered Storage

    Automatically moves data to lower-cost storage tiers based on its age using the lifecycle management feature.

    • Hot storage:

      • Hot storage is a scalable and high-availability data storage solution for frequently accessed data.

      • It supports real-time data access and provides high-performance log query and analysis functions. It is suitable for business scenarios that require frequent data queries and analysis.

    • IA storage class

      • The IA storage class (formerly cold storage) is a storage class that can reduce your long-term storage costs while ensuring that log query, analysis, visualization, alerting, shipping, and transformation capabilities are not affected.

      • It is suitable for business scenarios that require infrequent queries and analysis, such as issue tracing.

    • Archive Storage

      • Archive Storage provides a lower-cost, queryable, and analyzable long-term data storage solution based on the existing Hot and IA storage classes.

      • It is suitable for business scenarios that require long-term storage of audit data.

    Shards

    Each shard supports a write throughput of 5 MB/s and a read throughput of 10 MB/s. If the data traffic exceeds the service capabilities of a shard, split the shard. If the data traffic does not reach the maximum read and write capabilities of a shard, merge shards to save costs.

    Automatic Shard Splitting

    If the write volume to a shard exceeds its read/write capacity for more than 5 minutes, you can enable this feature to automatically increase the number of shards based on the data volume.

    Maximum Split Count

    After you enable automatic shard splitting, a maximum of 256 shards can be automatically created.

    Log Public IP

    After logs are received, the public IP address of the client and the time when the logs arrive at the server are automatically added.

API

CreateLogStore

Modify Logstore configuration

The following parameters can be configured when you create a Logstore. This section describes how to modify these parameters for an existing Logstore.

  1. Click image Log Storage. In the Logstores list, hover over the target Logstore and choose 修改日志库 > Modify.

  2. In the Logstore Attributes panel, modify the configuration items based on the following scenarios.

Set the data retention period and delete logs

Console

In the Basic Information section, click Modify, change the data retention period, and then click Save.

SLS does not allow you to delete specific log entries. To remove logs, you can expire them by changing the data retention period. Alternatively, you can delete all logs by stopping billing or deleting the Logstore.
  • Specified Days: Specify an integer from 1 to 3,650. A value of 3,650 indicates permanent storage. When the retention period expires, the logs are deleted.

  • Permanent Storage: Permanently retains all logs in the Logstore.

Note

The change takes effect immediately, but the deletion of expired data requires some time to complete.

API

In the UpdateLogStore operation, set the value of ttl to adjust the log retention period.

Use tiered storage to optimize storage costs

Console

  1. In the Basic Information section, click Modify and turn on the Intelligent Tiered Storage switch.

  2. Configure the Storage Policy. The total retention period across all three storage tiers must match the Data Retention Period.

    • Hot storage: at least 7 days.

    • IA storage class: at least 30 days.

    • Archive Storage: at least 60 days.

  3. Click Save. For more information, see Intelligent tiered storage.

API

In the UpdateLogStore operation, set the values of ttl, hot_ttl, and infrequentAccessTTL to dynamically adjust the retention policy for tiered storage.

Collect client-side logs

SLS provides the web tracking feature to collect logs from various clients, such as miniapps, mobile applications (iOS and Android), and web browsers.

You can use this feature in one of the following two ways:

  • Transmit data by using STS for authentication. This method is suitable for production scenarios. You do not need to modify the Logstore configuration.

  • Transmit data anonymously using OpenAPI. This method is suitable only for test scenarios. You must enable the switch in the Logstore. For more information, see the following content.

Console

In the Basic Information section, click Modify, turn on the WebTracking switch, and then click Save.

API

In the UpdateLogStore operation, set the enable_tracking parameter to true to enable the web tracking feature.

Automatically add the public IP address and arrival time to logs

After you enable this feature, the following information is automatically added to logs during data collection:

  • __tag__:__client_ip__: the public IP address of the device from which logs are sent.

  • __tag__:__receive_time__: the time when logs arrive at the SLS server. The time is a UNIX timestamp that indicates the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970.

Console

In the Basic Information section, click Modify, turn on the Log Public IP switch, and then click Save.

API

In the UpdateLogStore operation, use the appendMeta parameter to enable this feature.

Adjust collection performance using shards

Each shard supports a write throughput of 5 MB/s or 500 writes/s and a read throughput of 10 MB/s or 100 reads/s. These are soft limits. If the limits are exceeded, the system makes the best effort to provide services but does not guarantee service quality. If the read/write traffic exceeds the read/write capacity of a shard, you must split the shard. This increases the read/write capacity.

Console

In the Basic Information section, click Modify, turn on the Automatic Shard Splitting switch, set the split upper limit, and then click Save.

SLS lets you split and merge a specific shard.

API

SplitShard.

MergeShards.

Stop billing or delete a Logstore

Warning

After a Logstore is deleted, its stored log data is permanently deleted and cannot be recovered. Proceed with caution.

Console

  1. You can perform cleanup before deletion.

    1. Before you delete a Logstore, delete all its associated Logtail configurations.

    2. If data shipping is enabled for the Logstore, stop writing new data to the Logstore and make sure that all existing data in the Logstore is shipped before you delete the Logstore.

  2. Deletion procedure.

    1. On the Log Storage > Logstores tab, hover over the target Logstore and choose 修改日志库 > Delete.

    2. In the Warning dialog box, click Confirm Deletion.

  3. After deletion.

    1. Storage fees are incurred on the day you delete the Logstore. No fees are generated from the following day onward.

    2. After you delete a Logstore, the export tasks, data transformation jobs, and Scheduled SQL tasks that use the Logstore as a data source and the import tasks that use the Logstore as a destination are also deleted.

API

DeleteLogStore

Example configurations for common scenarios

Real-time monitoring and analysis for high-volume services

An online application generates a large volume of business logs in real time. When a failure occurs, you need to quickly locate error logs and monitor key metrics, such as queries per second (QPS) and response latency, with real-time alerts.

Recommended configuration: Standard Logstore + Pay-by-ingested-data + Automatic shard splitting.

Reasoning: A Standard Logstore supports analysis, real-time monitoring, and visualization. For high-volume log ingestion and analysis that may require extensive indexing, pay-by-ingested-data is recommended. Automatic shard splitting ensures sufficient performance for data ingestion and analysis.

Compliance, auditing, and security

Industry regulations require you to store user activity logs and security logs for six months or longer for auditing purposes. However, these logs are queried and analyzed infrequently.

Recommended configuration: Query Logstore + Intelligent tiered storage.

Reasoning: A Query Logstore supports queries only but has lower index traffic costs than a Standard Logstore. Intelligent tiered storage classifies log data based on its age, reducing long-term storage costs.

Related references

Comparison of Logstores in pay-as-you-go mode

The Query specification supports only the pay-as-you-go billing mode. The following table compares the Standard and Query Logstores in this mode.

Item

Standard

Query

Cost

Index traffic

USD 0.0875 per GB

USD 0.0146 / GB

Feature

Data collection (only for business system log scenarios)

Supported

Does not support collecting cloud product logs.

Enable intelligent tiered storage

Supported

Supported

Query

Supported

Supported

Analysis (SQL statement)

Supported

Unsupported

Contextual query

Supported

Support

LiveTail

Supported

Supported

LogReduce

Supported

Unsupported

Reindex

Supported

Supported

Dashboard

Support

Unsupported

Alerting

Supported

Only supports alerts based on query statements.

Scheduled SQL

Supported

Unsupported

Data transformation

Supported

Supported

Data shipping

Supported

Supported

Standard consumption

Supported

Supported

Limits

The pay-by-ingested-data mode supports the complete feature set of SLS. Value-added features such as query and analysis, data transformation, intelligent alerting, and data shipping and consumption do not incur additional fees, but are subject to quotas. The following table provides details.

Quota limit

Description

Data transformation volume

The maximum amount of data that can be transformed for a single Logstore is 100 TB per month.

Scheduled SQL data volume

The amount of data that can be processed using Scheduled SQL for a single Logstore is 20 TB per month.

Data shipping volume

The maximum amount of data that can be shipped from a single Logstore is 100 TB per month.

Data consumption volume

The maximum amount of data that can be consumed from a single Logstore is 100 TB per month.

Alerting job computation data volume

The amount of data that can be computed for alerting jobs for a single Logstore is 100 TB per month.

Billing

The cost of a Logstore is mainly determined by the selected billing mode.

  • Pay-as-you-go: You are billed for each resource that you use, such as storage capacity, index traffic, read/write operations, and the number of shards.

  • Pay-by-ingested-data: You are charged only for the amount of raw data that you write. This mode includes 30 days of free storage and multiple free features.

Key billing item prices:

  • Standard index traffic: CNY 0.350 per GB.

  • Query index traffic: USD 0.0146/GB.

Cost optimization recommendations:

  • If your log retention period is close to or exceeds 30 days, the pay-by-ingested-data mode is typically more cost-effective.

  • For scenarios that require only archiving and retrieval, use the Query specification to reduce indexing costs.

  • Configure intelligent tiered storage to move infrequently accessed data to lower-cost storage tiers.

FAQ

Why can't I create a Logstore?

You can create up to 200 Logstores per project by default. To create more, either delete unused Logstores or request a quota increase.

  1. Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage.

  2. On the project overview page, find Resource Quota in the basic information section and click Manage. In the Resource Quota panel, adjust the quota for the maximum number of Logstores and click Save to submit your request. The approval may take up to one hour.

Why are my logs in SLS missing?

  • Project or Logstore deletion

    If you manually delete a project or Logstore, the logs cannot be recovered. You can use ActionTrail to query for project or Logstore deletion events within the last 90 days.

  • Your account has an overdue payment. If your payment is more than 7 days overdue, your SLS projects are reclaimed. All data is erased and cannot be recovered. For more information, see Overdue payments.

How can I optimize log storage costs?