All Products
Search
Document Center

Container Service for Kubernetes:Collect container logs from an ACK Edge cluster

Last Updated:Sep 16, 2026

Alibaba Cloud ACK Edge integrates with Simple Log Service. You can enable Simple Log Service when you create an ACK Edge cluster to quickly collect the cluster's container logs, including standard output and text files.

Step 1: Enable the Logtail component

You can enable the Logtail component when you create an ACK Edge cluster by selecting Enable Log Service. The component can also be enabled for an existing ACK Edge cluster.

Enable Logtail when creating 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.

    The following steps describe only how 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 wizard, 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 Project. You can create a Project in one of the following ways:

    • Click Select Project and select an existing Project to manage the collected logs.

    • Click Create Project. A new Project is automatically created to manage the collected logs. The Project is automatically named k8s-log-{ClusterID}, where {ClusterID} is the unique ID of the new ACK Edge cluster.

  4. After you complete the configurations, click Create Cluster in the lower-right corner, and then click Confirm in the dialog box.

    After the cluster is created, the ACK Edge cluster with Logtail enabled appears 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, click the name of your cluster. In the left navigation pane, click Components and Add-ons .

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

    Note
    • For ACK Edge versions later than 1.18.8-aliyunedge.1, the log components are merged into logtail-ds.

    • For ACK Edge versions 1.18.8-aliyunedge.1 and earlier, the log components consist of alibaba-log-controller and logtail-ds-docker.

  4. In the row for the logtail-ds component, click Install. In the Install Comment dialog box, click OK.

    If an earlier version of the Simple Log Service component is installed, click Upgrade on the right side of the component.

Step 2: Configure Simple Log Service for applications

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

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

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Deployments.

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

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

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

  5. In the Log section, configure the log settings.

    1. Set the Collection Configuration.

      Important

      Log collection configurations cannot be modified after creation. To make changes, see Collect container logs by using a DaemonSet-CRD.

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

      • Logstore: Specify a name for the Logstore where collected logs are stored. If the specified Logstore does not exist, ACK automatically creates it in the Simple Log Service Project associated with the cluster.

        Note

        By default, logs in a newly created Logstore are retained for 180 days.

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

        Note

        If you specify stdout, Logtail collects the standard output (stdout) and standard error (stderr) of the container.

        Each collection configuration is automatically created for the corresponding Logstore, using simple mode (line-by-line collection) by default. For multi-line mode and more advanced collection methods, see Collect container text logs in DaemonSet mode by using the console and Collect container standard output in DaemonSet mode by using the console.

      Before you proceed, make sure that the log plug-in is deployed in the cluster. For example, you can set the Logstore fields to access and catalina respectively.

    2. Set Custom Tags.

      Click Custom Tag. Each custom tag is a key-value pair appended to the collected logs. You can use these tags to label a container's log data with information such as a version number.

      For example, set Tag Name to release and Tag Value to 1.0.0.

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

    For information about subsequent steps, see Create a stateless Deployment.

Step 3: View logs

After you configure log collection for the Tomcat application, the logs are stored in Simple Log Service. You can then view the container logs in the Simple Log Service console.

  1. Go to the Simple Log Service console.

  2. In the Projects section, select the Project for your Kubernetes cluster (by default, k8s-log-{ClusterID}). Then, go to the Logstore tab.

  3. Find the Logstore that you specified in the collection configuration. In the row for the Logstore, click the button icon and select Query and Analysis.

    On the log query page, you can view the application's standard output and in-container text logs. The custom tags that you added are also appended to the log fields.

Related documents