Help Center> Log Tank Service> Getting Started> Step 1: Creating Log Groups and Log Streams
Updated on 2024-02-06 GMT+08:00

Step 1: Creating Log Groups and Log Streams

Log groups and log streams are basic units for log management in LTS. Before using LTS, create a log group and a log stream.

Prerequisites

You have registered with Huawei Cloud.

Creating a Log Group

  1. Log in to the LTS console. On the Log Management page, click Create Log Group.
  2. In the dialog box displayed, enter a log group name.
    • Collected logs are sent to the log group. 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.
    • The log name can contain 1 to 64 characters, including only letters, digits, hyphens (-), underscores (_), and periods (.). It cannot start with a period or underscore or end with a period.
  3. Set Log Retention Duration. You can set it to 1 to 365 days. If this parameter is not specified, logs are retained for 30 days by default.

    Currently, logs of whitelisted users can be retained for 1,095 days. If necessary, submit a service ticket.

    Figure 1 Creating a log group

    LTS offers a free quota of 500 MB per month for log read/write, log retention, and log indexing. When the free quota is used up, you will be billed for excess usage on a pay-per-use basis.

  4. Set the tag value in the Key = Value format, for example, a=b.
  5. Enter remarks. The value contains 0 to 1024 characters.
  6. Click OK.
    • In the log group list, you can view information such as the log group name, tags, and log streams.
    • Click the log group name, the details page of one of its log streams is displayed.
    • When multiple log groups are created concurrently, there may be a limit exceeding error.

Creating a Log Stream

  1. Click on the left of a log group name.
  2. Click Create Log Stream.
  3. In the dialog box displayed, enter a log stream name.
    • A log stream name can contain 1 to 64 characters, including only letters, digits, hyphens (-), underscores (_), and periods (.). It cannot start with a period or underscore or end with a period.
    • Collected logs are sent to the created log stream. If there are a large number of logs, you can create multiple log streams and name them for quick log search.
    Figure 2 Creating a log stream
  4. Select the required enterprise project in Enterprise Project Name. The default value is default. You can click View Enterprise Projects to view all enterprise projects.
  5. Enable Log Retention Duration as required. If you enable it, you can set the log retention duration specifically for the log stream. If you disable it, the log stream will inherit the log retention setting of the log group.
  6. Anonymous write is disabled by default and applies to log reporting on Android, iOS, applets, and browsers. If anonymous write is enabled, the anonymous write permission is granted to the log stream, and no valid authentication is performed, which may generate dirty data.
  7. Set tags in the Key = Value format, for example, a=b.
  8. Enter custom remarks. The value contains 0 to 1,024 characters.
  9. Click OK. In the log stream list, you can view information such as the log stream name, enterprise project, and tags.