All Products
Search
Document Center

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

Last Updated:Mar 26, 2026

ACK Edge integrates with Simple Log Service to collect container logs from edge clusters. This topic describes how to enable the log collection agent, configure which logs to collect per workload, and verify that logs are visible in Simple Log Service.

Collected log types: standard container output (stdout/stderr) and text files within containers.

Prerequisites

Before you begin, make sure you have:

  • An ACK Edge cluster (see Create an ACK Edge cluster)

  • A Simple Log Service project, or permission to create one automatically during cluster setup

Collection defaults

SettingDefault
Collection modeSimple mode (line by line)
Log retention period180 days
Logstore creationAuto-created in the project associated with the cluster if it does not exist

Step 1: Enable the Logtail component

Enable the Logtail log collection agent when you create a cluster, or add it to an existing 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 covers only the log-related steps. For the full cluster creation procedure, see Create an ACK Edge cluster.

  3. In the Component Configurations step, select Enable Log Service. After selecting Enable Log Service, associate a project to manage the collected logs. For background on how Simple Log Service organizes logs, see Projects. Two options are available:

    • Click Select Project to use an existing project. 使用已有Project

    • Click Create Project to auto-create a project named k8s-log-{ClusterID}, where {ClusterID} is the unique ID of the new cluster. 创建新Project

  4. Click Create Cluster in the lower-right corner. In the dialog box that appears, click OK. After the cluster is created, it appears on the Clusters page with Logtail enabled.

Enable Logtail on an existing cluster

The log component name depends on the cluster version:
Version later than 1.18.8-aliyunedge.1: logtail-ds
Version 1.18.8-aliyunedge.1 or earlier: alibaba-log-controller and logtail-ds-docker
  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster you want to manage. 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.

  4. Click Install. In the Install logtail-ds dialog box, click OK. If an earlier version of the log component is installed, click Upgrade instead.

Step 2: Configure log collection for an application

Important

A log collection configuration cannot be modified after it is created. To change an existing configuration, use a CRD instead — see Use a CRD to collect container logs in DaemonSet mode.

Configure log collection when creating a new application workload.

  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, 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 covers only the log-related settings. For all other application settings, see Create a stateless workload (Deployment).

  5. In the Log section, configure the following: Collection Configuration Click Collection Configuration. Each configuration maps a Logstore to a log path in the container. Logs are collected in simple mode (line by line) by default. For multi-line mode or 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. Custom Tag Click Custom Tag to add key-value pairs to the collected logs. Custom tags let you label log data by container metadata, such as a version number.

    • Logstore: The name of the Logstore where collected logs are stored. If the Logstore does not exist, ACK creates it automatically in the cluster's associated Simple Log Service project.

    • Log Path in Container: The path of the logs to collect. For example, /usr/local/tomcat/logs/catalina.*.log collects text logs from Tomcat. Set this to stdout to collect standard output (stdout) and standard error (stderr).

    采集配置

    自定义tag

  6. Click Next in the upper-right corner to proceed. For subsequent configuration steps, see Create a stateless workload (Deployment).

Step 3: View logs

After configuration is complete, logs are collected and stored in Simple Log Service. The following example shows how to view logs for a Tomcat application created through the console.

  1. Log on to the Simple Log Service console.

  2. In the Projects section, select the project associated with your cluster. The default project name is k8s-log-{ClusterID}. Then click the Logstores tab.

  3. Find the Logstore 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. The log query page shows the standard output logs and in-container text logs of the application. Custom tags appear as additional log fields.

What's next

If something went wrong:

To collect more log types:

To extend or manage your setup: