All Products
Search
Document Center

Container Service for Kubernetes:Use Simple Log Service to collect container logs from ACK Edge clusters

Last Updated:Dec 01, 2025

ACK Edge is integrated with Simple Log Service. When you create an ACK Edge cluster, you can enable Simple Log Service to collect container logs from the ACK Edge cluster. The collected logs include standard container output and text files within containers. This topic describes how to use Simple Log Service to collect logs from edge containers.

Step 1: Enable the Logtail component

You can select Enable Log Service  to enable the Logtail component when you create an ACK Edge cluster. You can also enable the Logtail component for an existing ACK Edge cluster.

Enable Logtail When You Create A Cluster

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click Create Kubernetes Cluster.

    This section describes only the key steps to enable Simple Log Service. For more information about how to create a cluster, see Create an ACK Edge cluster.

  3. In the Component Configurations step, select Enable Log Service.

    After you select Enable Log Service, you are prompted to create a project. For more information about how Simple Log Service organizes logs, see Projects. You can create a project in one of the following ways.

    • Click Select Project and select an existing project to manage the collected logs. 使用已有Project

    • Click Create Project to automatically create a project to manage the collected logs. The project is automatically named k8s-log-{ClusterID}. {ClusterID} is the unique ID of the new ACK Edge cluster. 创建新Project

  4. After you complete the configurations, click Create Cluster in the lower-right corner. In the dialog box that appears, click OK to create the cluster.

    After the cluster is created, you can find the ACK Edge cluster with Logtail enabled on the Clusters page.

Enable Logtail For An Existing Cluster

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, find the one you want to manage and click its name. In the left navigation pane, click Add-ons.

  3. On the Add-ons page, click the Logs and Monitoring tab and find the logtail-ds component.

    Note
    • For ACK Edge clusters that run a version later than 1.18.8-aliyunedge.1, the log component is logtail-ds.

    • For ACK Edge clusters that run version 1.18.8-aliyunedge.1 or earlier, the log component consists of alibaba-log-controller and logtail-ds-docker.

  4. For the logtail-ds component, click Install. In the Install logtail-ds dialog box, click OK.

    If an earlier version of the log component is installed, click Upgrade for the component.

Step 2: Configure Simple Log Service when you create an application

You can configure Simple Log Service when you create an application to collect logs from an ACK Edge cluster.

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, find the cluster you want to manage and click its name. In the left navigation pane, choose Workloads > Deployments.

  3. On the Deployments page, select a namespace from the Namespace drop-down list. Then, click Create from Image in the upper-right corner.

  4. On the Basic Information tab, set Name, Replicas, and Type. Click Next to go to the Container page.

    This section describes only the configurations related to Simple Log Service. For more information about other application configurations, see Create a stateless workload (Deployment).

  5. In the Log section, configure log parameters.

    1. Set Collection Configuration.

      Important

      You cannot modify a log collection configuration after it is created. To modify the configuration, see Use a CRD to collect container logs in DaemonSet mode.

      Click Collection Configuration. Each collection configuration consists of a Logstore and a Log Path In Container.

      • Logstore: The name of the Logstore. The collected logs are stored in this Logstore. If the Logstore does not exist, ACK automatically creates one in the Simple Log Service project that is associated with the cluster.

        Note

        By default, logs in a new Logstore are saved for 180 days.

      • Log Path in Container: The path of the logs that you want to collect. For example, use /usr/local/tomcat/logs/catalina.*.log to collect text logs from Tomcat.

        Note

        If you set this parameter to stdout, the standard output (stdout) and standard error (stderr) of the container are collected.

        A collection configuration is automatically created for the corresponding Logstore. By default, logs are collected in simple mode (line by line). To use multi-line mode or more advanced collection methods, see Collect container text logs in DaemonSet mode using the console and Collect container standard output in DaemonSet mode using the console.

      采集配置

    2. Set Custom Tag.

      Click Custom Tag. Each custom tag is a key-value pair that is appended to the collected logs. You can use custom tags to mark the log data of a container, such as a version number.

      自定义tag

  6. After you complete all configurations, click Next in the upper-right corner to proceed.

    For information about subsequent operations, see Create a stateless workload (Deployment).

Step 3: View logs

This example shows how to view the logs of a Tomcat application that is created using the console wizard. After the configurations are complete, the logs of the Tomcat application are collected and stored in Simple Log Service. You can view the container logs in the Simple Log Service console.

  1. Log on to the Simple Log Service console.

  2. After you log on to the console, in the Projects section, select the project that is associated with the Kubernetes cluster. By default, the project is named k8s-log-{ClusterID}. Then, click the Logstores tab.

  3. Find the target Logstore in the list. This is the Logstore that you specified in the collection configuration. Move the pointer over the right side of the Logstore name, click the button icon, and then click Search & Analysis.

    In this example, on the log query page, you can view the standard output logs and in-container text logs of the Tomcat application. The custom tags are also added to the log fields.

References