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
| Setting | Default |
|---|---|
| Collection mode | Simple mode (line by line) |
| Log retention period | 180 days |
| Logstore creation | Auto-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
Log on to the ACK console. In the left navigation pane, click Clusters.
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.
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.

Click Create Project to auto-create a project named
k8s-log-{ClusterID}, where{ClusterID}is the unique ID of the new cluster.
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
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of the cluster you want to manage. In the left navigation pane, click Add-ons.
On the Add-ons page, click the Logs and Monitoring tab and find 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 instead.
Step 2: Configure log collection for an application
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.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, choose Workloads > Deployments.
On the Deployments page, select a namespace from the Namespace drop-down list, then click Create from Image in the upper-right corner.
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).
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.*.logcollects text logs from Tomcat. Set this tostdoutto collect standard output (stdout) and standard error (stderr).


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.
Log on to the Simple Log Service console.
In the Projects section, select the project associated with your cluster. The default project name is
k8s-log-{ClusterID}. Then click the Logstores tab.Find the Logstore you specified in the collection configuration. Move the pointer over the right side of the Logstore name, click the
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:
Logstore-related FAQ — covers changing the log retention period, disabling log collection, and similar operations
To collect more log types:
Collect text logs from Kubernetes containers using a sidecar
Collect the standard output of Kubernetes containers in DaemonSet mode (legacy)
To extend or manage your setup:
Manage alert rules — add alert rules for logs to monitor cluster status
Use Logtail to collect container logs across Alibaba Cloud accounts