Manage Logstores
A Logstore is a storage unit in Simple Log Service (SLS) 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 under a Project to isolate and manage logs from different applications or sources.
Additionally, certain Alibaba Cloud services or SLS features automatically create dedicated Logstores for specific purposes. These Logstores cannot accept other types of data. Examples include the following:
internal-operation_log: stores detailed operation logs generated by Simple Log Service itself.oss-log-store: automatically created when you configure OSS access logs for archival.
LogStore specification comparison
Simple Log Service offers two Logstore types—Standard and Query—that differ in features and cost.
Type | Cost (Index Traffic Fee Comparison) | Scenarios |
Standard | CNY 0.350/GB | Use this type for interactive analytics, real-time monitoring, visualization, or building observability systems. |
Query type (Query) | CNY 0.1/GB | This type does not support analytics. Use it for log archival, audit log storage, or troubleshooting scenarios where you only need fast keyword search without analysis. Typical use cases include long-term retention (months or years) with infrequent access. |
Scope and permissions
Create a basic Logstore
Console
Log on to the Simple Log Service console. In the Project list, click the target Project.
On the tab, click the + icon.
On the Create Logstore page, configure the settings and click OK.
Logstore type: Standard by default.
Billing mode:
Pay-by-feature: You are billed separately for each resource used (such as storage, indexing, and read/write operations) and receive a monthly free quota, which helps control costs in small-scale scenarios.
Pay-by-ingested-data: You pay only for the raw ingested data volume. Storage and core features are free for 30 days, offering a simpler and more cost-effective pricing model.
Quick tip: The closer your retention period is to 30 days and the more fields you index (especially full-text indexing), the more suitable pay-by-ingested-data becomes.
Logstore name: Must be unique within the Project and cannot be changed after creation.
Data retention period: 30 days by default.
Keep all other settings at their default values.
API
Modify Logstore configuration
You can configure the following parameters during creation. This section uses Logstore modification as an example.
Click
Log Storage. On the Logstores page, hover over the target Logstore and select .In the Logstore properties, modify the relevant settings based on your scenario.
Delete specific logs or set log retention period
Console
In Basic Information, click Modify, adjust the data retention period, and click Save.
Simple Log Service supports deleting specific log entries by using the Log Soft Delete feature. On the Query and Analysis page of the LogStore, enter query conditions, select a time range, and click Log Soft Delete to submit a deletion task. Deleted log entries no longer appear in subsequent queries and are permanently deleted after the retention period ends. You can also delete expired logs in batches by changing the data retention period, or by stopping billing or deleting the LogStore to remove all logs.
Specified Days: Valid values: 1–3650. Setting this to 3650 means permanent retention. Logs are deleted when the retention period ends.
Permanent Storage: Retains logs in the Logstore indefinitely.
Changes take effect immediately, but deleting expired data may take some time.
Verify that the change takes effect
After the change is saved, hover over the LogStore again and click Modify. In the LogStore properties, check whether the number of days displayed for Data Retention Period is the value that you set, which confirms that the setting is applied. If permanent retention is enabled for the LogStore, no custom number of days is displayed, which means that logs in this LogStore are kept until you change the setting.
Troubleshoot a Data Retention Period that cannot be modified or fails to save
If Data Retention Period cannot be edited (the retention period edit button is dimmed or the storage duration cannot be selected), or an error is returned when you save the change and the lifecycle settings cannot be completed, check the following items in order:
The LogStore is a dedicated LogStore that a cloud service or Simple Log Service created automatically. Automatic creation applies to Redis dedicated LogStores, MongoDB dedicated LogStores, and Simple Log Service management dedicated LogStores, whose data retention period is managed by the corresponding cloud service. When you save the change in the Simple Log Service console, a message prompts you to perform the operation in the console of that cloud service. To use a custom retention period, adjust it in the console of the corresponding cloud service, or create a standard LogStore for your business logs.
The LogStore is a system-reserved LogStore with the
internal-prefix, for exampleinternal-operation_log,internal-alert-history, orinternal-etl-log. Such a LogStore is already bound to a specific data import configuration, and the console indicates that the current LogStore is configured for a specific data import, so its configuration items cannot be customized.The current account does not have sufficient permissions. Modifying a LogStore configuration requires the LogStore management permissions on the target Project, that is, permissions such as
log:*LogStorelisted in the Scope and permissions section of this topic. If you log on as a Resource Access Management (RAM) user, request theAliyunLogFullAccesssystem policy, or a custom policy that contains these permissions, from the Alibaba Cloud account owner.The console page is not displayed correctly. Refresh the page or switch to another browser, hover over the target LogStore again, click Modify, and then modify Data Retention Period again.
In standard scenarios, you can also complete the setting by modifying
ttlas described on the API tab of this section. For the dedicated LogStores described above, you must still adjust the retention period in the console of the corresponding cloud service.
API
Adjust the log retention period by updating the ttl value in Update Logstore.
Optimize storage costs using tiering
Console
In Basic Information, click Modify and enable intelligent tiering.
Configure the Storage Policy: The sum of days across all three tiers must equal the total data retention period.
Hot storage: minimum 7 days.
IA storage class: minimum 30 days.
Archive Storage: minimum 60 days.
Set Data retention period to Limited days, enable Intelligent tiering, and configure tier transitions in Storage policy: hot storage automatically transitions to IA storage after its period ends, IA storage transitions to Archive Storage, and Archive Storage is automatically deleted after its period ends.
Click Save. For details, see Intelligent tiering.
API
Dynamically adjust the retention policy for storage tiers by updating the ttl, hot_ttl, and infrequentAccessTTL values in Update Logstore.
Collect frontend logs
Simple Log Service provides WebTracking to collect logs from mini programs, mobile apps (iOS/Android), and browsers.
You can use this feature in two ways:
Use STS authentication for transmission. This method is suitable for production environments and does not require Logstore configuration changes.
Use anonymous transmission via OpenAPI. This method is for testing only and requires enabling a setting in the Logstore, as described below.
Console
In Basic Properties, click Modify, enable WebTracking, and click Save.
API
Enable WebTracking by setting the enable_tracking parameter to true in Update Logstore.
Add public IP and log arrival time automatically
When enabled, subsequent log ingestion automatically adds:
__tag__:__client_ip__: the public IP address of the log source device.
__tag__:__receive_time__: the time the log arrives at the Simple Log Service server, formatted as a UNIX timestamp (seconds since 1970-01-01 00:00:00 UTC).
Console
In Basic Properties, click Modify, enable Record public IP, and click Save.
API
Enable public IP recording by setting the appendMeta parameter in Update Logstore.
Adjust ingestion performance using shards
Each shard supports 5 MB/s or 500 writes per second for ingestion, and 10 MB/s or 100 reads per second for consumption. These are soft limits. The system tries to serve requests beyond these limits but does not guarantee quality of service. If traffic exceeds a shard’s capacity, split the shard to increase capacity.
Console
In Basic Properties, click Modify, enable Automatic sharding, set the shard limit, and click Save.
Simple Log Service supports splitting and merging individual shards.
API
Stop billing or delete Logstore
Once deleted, all log data in the Logstore is permanently lost and cannot be recovered. Proceed with caution.
Console
Clean up before deletion.
Delete all associated Logtail configurations before deleting the LogStore. This is the only hard prerequisite check that the console performs when you delete a LogStore: if the LogStore is still associated with Logtail collection configurations, the console reports that Logtail configurations exist and must be deleted first, and the deletion cannot continue. Therefore, if a LogStore cannot be deleted, first delete all Logtail collection configurations of that LogStore, and then delete the LogStore again.
If LogShipper is enabled for this Logstore, stop writing new data and confirm all existing data has been successfully shipped before deletion.
In the section, review all tasks for the current Project and delete any tasks associated with this Logstore.
Release Protection of a Project applies to the Project itself: after it is enabled, you must manually disable it before you can delete the Project. Deleting a single LogStore is not affected by this feature, so you do not need to disable it.
Deletion steps.
On the tab, hover over the target Logstore and select .
In the Warning dialog box, click Confirm Deletion.
Post-deletion notes.
Storage fees still apply on the day of deletion. No fees accrue from the next day onward. You will not receive a bill for this Logstore starting on the third day after deletion.
After deletion, all export tasks, data transformation jobs, scheduled SQL tasks using this Logstore as a source, and import tasks targeting this Logstore are deleted.
API
Configuration examples for real-world scenarios
Real-time monitoring and analysis for high-volume workloads
Your online application generates large volumes of logs in real time. When failures occur, you need to quickly locate error logs and monitor performance metrics (such as QPS and response latency) with real-time alerts.
Recommended configuration: Standard Logstore + pay-by-ingested-data + automatic sharding.
Reason: Standard Logstore supports analytics, real-time monitoring, and visualization. With high ingestion volume and potential need for extensive indexing, pay-by-ingested-data offers better cost efficiency, and automatic sharding ensures consistent ingestion and analysis performance.
Compliance, auditing, and regulatory scenarios
Industry regulations require storing user operation logs and security logs for more than six months for auditing, but daily query and analysis frequency is very low.
Recommended configuration: Query Logstore + intelligent tiering.
Reason: Query Logstore supports search-only workloads at a lower index traffic cost than Standard. Intelligent tiering reduces long-term storage costs by automatically moving older logs to lower-cost storage tiers.
Related references
Logstore comparison under pay-by-feature billing
Query Logstores support only pay-by-feature billing. Under this model, Standard and Query Logstores compare as follows:
Comparison Item | Standard | Query Specification | |
Cost | CNY 0.350/GB | CNY 0.1/GB | |
Features | Data ingestion (for application logs only) | Supported | Does not support cloud product log ingestion. |
Supported | Supported | ||
Supported | Supported | ||
Analytics (SQL statement) | Supported | Not supported | |
Supported | Supported | ||
Supported | Supported | ||
Supported | Not supported | ||
Supported | Supported | ||
Supported | Not supported | ||
Supported | Supports only query-based alerts | ||
Supported | Not supported | ||
Supported | Supported | ||
Supported | Supported | ||
Supported | Supported | ||
Limits
Pay-by-ingested-data supports the full SLS feature set. Value-added features such as query and analysis, data transformation, intelligent alerting, and consumption/shipping incur no extra charges but are subject to quota limits as follows.
Quota limit | Description |
Data transformation volume | Maximum 100 TB per Logstore per month. |
Scheduled SQL data volume | Maximum 20 TB per Logstore per month. |
Shipping data volume | Maximum 100 TB per Logstore per month. |
Consumption data volume | Maximum 100 TB per Logstore per month. |
Alert job computation volume | Maximum 100 TB per Logstore per month. |
Billing overview
Logstore costs depend primarily on the selected billing mode.
Pay-by-feature: You are billed separately for actual usage of resources such as storage capacity, index traffic, read/write operations, and shard count.
Pay-by-ingested-data: You pay only for the raw ingested data volume, with 30 days of free storage and multiple free features included.
Key pricing details:
Standard index traffic: CNY 0.350 /GB.
Query index traffic: CNY 0.1 /GB.
Cost optimization tips:
If your log retention period is close to or exceeds 30 days, pay-by-ingested-data is usually more cost-effective.
For archival and retrieval-only scenarios, use Query Logstores to reduce indexing costs.
Use intelligent tiering to move infrequently accessed data to lower-cost storage tiers.
FAQ
Cannot create a Logstore
By default, you can create up to 200 Logstores per Project. Delete unused Logstores or request a quota increase as follows.
Log on to the Simple Log Service console, and click the target Project in the Project list.
On the Project page, go to Overview > Basic Information > Resource Quota and click Manage. In the Resource Quotas panel, adjust the Logstore quota limit and click Save to submit your request. Allow about one hour for the change to take effect.
Are logs missing in Simple Log Service?
Project or Logstore missing
If you manually delete a Project or Logstore, logs cannot be recovered. Use ActionTrail to check for deletion events within the last 90 days.
No logs were collected. For more information, see Troubleshooting Guide for LoongCollector Log Collection Issues.
If your account remains overdue for more than 7 days, the service is considered abandoned. Projects are reclaimed and data is permanently deleted. For details, see Overdue payments.
How can I reduce log storage costs?
To check your SLS billing, see View SLS storage capacity and consumption records.
Download historical logs locally or ship them to OSS for storage.
How do I identify the data source of the logs collected into a LogStore?
If a Project contains LogStores that you did not create, or you are not sure which cloud service writes logs into a LogStore, use the following methods to confirm the data source and the log source service:
Check the data import configuration of the LogStore: Logtail collection configurations and the shipping or import configurations of cloud service logs correspond directly to the data sources that write into the LogStore. This is the most direct way to confirm the source.
View Raw Logs on the Query and Analysis page of the LogStore: the Time/IP column of each log entry displays the source identifier field
__source__. Logs that Logtail collects from files also carry reserved fields such as__tag__:__path__, whose names are Simple Log Service reserved words, and you can use these fields to determine the runtime source of the logs.Check the description of the Project: a Project that comes from automatic creation by a cloud service usually states its purpose and source in the description.
LogStores with the
internal-prefix, for exampleinternal-operation_log,internal-alert-history, andinternal-etl-log, are reserved by Simple Log Service for specific data imports. For these LogStores, the console indicates that the current LogStore is configured for a specific data import and that its configuration items cannot be customized.Do not rely on the
productTypefield returned byGetLogStoreto determine the source: this field is not defined in the Simple Log Service OpenAPI and its values are not standardized. Use it only as an auxiliary signal, never as the only basis for your conclusion.
Is raw log storage enabled by default for a LogStore?
Yes. Raw log storage is enabled by default and requires no manual configuration. After logs are written into a LogStore, the raw logs are stored, and Simple Log Service does not provide a separate switch for raw log storage. How long the logs are kept is determined by the Data Retention Period of the LogStore.
To confirm this, log on to the Simple Log Service console, go to the Query and Analysis page of the target LogStore, select a time range, and view the written logs on the Raw Logs tab. The Raw Logs tab is also available when indexing is disabled for the LogStore. If the page indicates that indexing is not enabled, you can query only the data that is written after indexing takes effect.