Help Center/ Log Tank Service/ Getting Started/ Creating Log Groups and Log Streams
Updated on 2025-08-13 GMT+08:00

Creating Log Groups and Log Streams

Prerequisites

You have obtained an account and its password for logging in to the console.

Creating a Log Group

  1. Log in to the management console and choose Management & Deployment > Log Tank Service.
  2. On the Log Management page, click Create Log Group.
  3. In the dialog box displayed, set log group parameters by referring to Table 1.
    Table 1 Log group parameters

    Parameter

    Description

    Log Group Name

    A log group is the basic unit for LTS to manage logs. It is used to classify log streams. If there are too many logs to collect, separate logs into different log groups based on log types, and name log groups in an easily identifiable way.

    LTS automatically generates a default log group name. You are advised to customize one based on your service. You can also change it after the log group is created. The naming rules are as follows:

    • Enter 1 to 64 characters, including only letters, digits, hyphens (-), underscores (_), and periods (.). Do not start with a period or underscore or end with a period.
    • Each log group name must be unique.

    Enterprise Project Name

    Enterprise projects allow you to manage cloud resources and users by project.

    By default, the default enterprise project is used. You are advised to select an enterprise project that fits your service needs. To see all available options, click View Enterprise Projects.

    Log Retention (Days)

    Specify the log retention period for the log group, that is, how many days the logs will be stored in LTS after being reported to LTS.

    By default, logs are retained for 30 days. You can set the retention period to one to 365 days.

    Tag

    Tag the log group as required. Click Add Tags and enter a tag key and value. If you enable Apply to Log Stream, the tag will be applied to all log streams in the log group. To add more tags, repeat this step. A maximum of 20 tags can be added.

    Tag key restrictions:

    • A tag key can contain letters, digits, spaces, and special characters (_.:=+-@), but cannot start or end with a space or start with _sys_.
    • A tag key can contain up to 128 characters.
    • Each tag key must be unique.

    Tag value restrictions:

    • A tag value can contain letters, digits, spaces, and the following special characters: _.:=+-@
    • A tag value can contain up to 255 characters.

    Deleting a tag:

    Click Delete in the Operation column of the tag.

    WARNING:

    Deleted tags cannot be recovered.

    If a tag is used by a transfer task, you need to modify the task configuration after deleting the tag.

    Remark

    Enter remarks. The value contains up to 1,024 characters.

  4. Click OK. The created log group will be displayed in the log group list.

Creating a Log Stream

  1. Click on the left of a log group name and click Create Log Stream.
  2. In the dialog box displayed, set log stream parameters by referring to Table 2.
    Table 2 Log stream parameters

    Parameter

    Description

    Log Group Name

    Defaults to name of the log group to which the log stream belongs and be unmodifiable.

    Stream Type

    Select a log stream type as required.

    • Standard log streams support all LTS functions and are designed to build a complete observability system.
    • Search log streams support only keyword-based search. They do not support quick analysis, statistical charts, log analysis, and SQL alarms. They are ideal for log search scenarios. They offer a cost advantage, with index traffic fees reduced by 69% compared to standard log streams.

    Log Stream Name

    LTS automatically generates a default log stream name. You are advised to customize one based on your service. You can also change it after the log stream is created. The naming rules are as follows:

    • Use only letters, digits, hyphens (-), underscores (_), and periods (.). Do not start with a period or underscore or end with a period.
    • Enter 1 to 64 characters.
    • Each log stream name must be unique.

    Enterprise Project Name

    Select the required enterprise project. The default value is default. You can click View Enterprise Projects to view all enterprise projects.

    Log Storage

    If this function is disabled, Log Retention (Days) cannot be enabled.

    • If this function is enabled, logs will be stored in the search engine and all log functions are available.
    • If this function is disabled, logs will not be stored to LTS. This saves on index traffic and storage costs, but disables log search, analysis, alarm, consumption, and processing. You will only be allowed to use metric generation and log transfer functions.

    Log Retention (Days)

    Specify the log retention period for the log stream, that is, how many days the logs will be stored in LTS after being reported to LTS.

    By default, logs are retained for 30 days. You can set the retention period to one to 365 days.

    • If you enable Log Retention (Days) for the log stream, logs are retained for the period set for the log stream.
    • If you disable Log Retention (Days) for the log stream, logs are retained for the period set for the log group.
    • The logs that exceed the retention period will be automatically deleted. You can transfer logs to OBS buckets for long-term storage.

    Shards

    This parameter is valid only for log consumption. Each shard has a limit of 5 MB/s for writes and 10 MB/s for reads. When the log read/write traffic exceeds these limits, LTS automatically adds more shards. You can also manually add shards. The value ranges from 1 to 64.

    Click View Shard Details to view the shards' statuses and creation time.

    Tag

    Tag the log stream as required. Click Add Tags and enter a tag key and value. To add more tags, repeat this step. A maximum of 20 tags can be added.

    Tag key restrictions:

    • A tag key can contain letters, digits, spaces, and special characters (_.:=+-@), but cannot start or end with a space or start with _sys_.
    • A tag key can contain up to 128 characters.
    • Each tag key must be unique.

    Tag value restrictions:

    • A tag value can contain letters, digits, spaces, and the following special characters: _.:=+-@
    • A tag value can contain up to 255 characters.

    Deleting a tag:

    Click Delete in the Operation column of the tag.

    WARNING:

    Deleted tags cannot be recovered.

    If a tag is used by a transfer task, you need to modify the task configuration after deleting the tag.

    Remark

    Enter remarks. The value contains up to 1,024 characters.

  3. Click OK. The created log stream will be displayed under the target log group.