All Products
Search
Document Center

Platform For AI:Configure log service for a resource group

Last Updated:May 08, 2026

You can configure Simple Log Service (SLS) to collect logs from Elastic Algorithm Service (EAS) services deployed in a resource group. These logs, including standard output or custom files, are sent to a target Logstore. This topic describes how to configure log collection for public and dedicated resource groups.

Prerequisites

Before you begin, ensure you have activated Simple Log Service (SLS) and created a Project and a Logstore. For more information, see Collect and analyze text logs from ECS instances.

Step 1: Create a machine group for the resource group

Public resource group

For services deployed in a public resource group, you must create a machine group manually.

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the one you want.

    image

  3. In the left-side navigation pane, choose Resources > Machine Groups.

  4. On the right side of Machine Groups, choose 机器组 > Create Machine Group.

  5. Create a machine group using a custom identifier.

    Important

    The dedicated custom identifier for the EAS service is eas-log-group-{region_id}. For example, the custom identifier for Zhangjiakou is eas-log-group-cn-zhangjiakou.

    image

  6. After the service is deployed, open the Machine Group Configuration page. In the Machine Group Status list, you can view the heartbeat status of the instances. OK indicates the machine group is running properly.

    Note

    If no service is deployed, the instance list is empty.

    机器组状态

Dedicated resource group

To enable log delivery to SLS for a dedicated resource group, perform the following steps in the EAS console.

  1. Log on to the PAI console. Select a region on the top of the page. Then, select the desired workspace and click Elastic Algorithm Service (EAS).

  2. On the Resource Group tab, click a resource group name to open its details page.

  3. On the dedicated resource group details page, click Configure SLS.

    image

  4. In the Configure Log Service Settings dialog box, select the SLSProject and logstore, and then click OK.

    Parameter

    Description

    SLSProject

    A resource management unit in Simple Log Service for resource isolation and control. If no Project is available, click Create SLSProject to create one. For more information, see Manage Projects.

    logstore

    A unit in Simple Log Service for collecting, storing, and querying log data. If no Logstore is available in the drop-down list, click Create Logstore to create one. For more information, see Create a Logstore.

    After the service is activated, a machine group is automatically created in SLS with a name in the format eas-sls-{resource-id}-mg, for example, eas-sls-eas-r-9u2lq6ij1pk5yvvh****-mg. In this format, resource-id is the resource group ID.

    EAS also automatically creates a Logtail configuration in the specified Logstore to collect EAS internal logs.

Resource quota

If you use a resource quota (Lingjun), follow these steps to create a machine group.

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the one you want.

    image

  3. In the left-side navigation pane, choose Resources > Machine Groups.

  4. On the right side of Machine Groups, choose 机器组 > Create Machine Group.

  5. Create a machine group using a custom identifier.

    Important

    The custom identifier for the resource quota is eas-log-group-{region_id}-for-resource-quota. For example, the custom identifier for the Zhangjiakou region is eas-log-group-cn-zhangjiakou-for-resource-quota.

    image

  6. After the service is deployed, open the Machine Group Configuration page. In the Machine Group Status list, you can view the heartbeat status of the instances. OK indicates the machine group is running properly.

    Note

    If no service is deployed, the instance list is empty.

    机器组状态

Step 2: Configure a Logtail

You can configure a Logtail to collect logs. This section describes two common configurations: container standard output and container file logs. For more complex configurations, see Collect text logs from hosts.

Public and dedicated resource groups

Container standard output

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, click K8S-Std-Output(Old).

    image

  3. Select the target Project and Logstore, and then click Next.

  4. Click Use Existing Machine Groups, select the machine group from Step 1 (the one you manually created for a public resource group or the one EAS automatically created for a dedicated resource group), and then click Next.

  5. (Optional) To exclude EAS internal logs when using a custom image, enable Container Filtering in the Input configuration section. Then, add a Container Label Blacklist. Set Label Name to io.kubernetes.container.name and Label Value to easworker.

  6. Click Next until the configuration is complete.

Container file logs

  1. In the Import Data section, click Kubernetes - File.

    Kubernetes-文件

  2. Select the target Project and Logstore, and then click Next.

  3. Click Use Existing Machine Groups, select the machine group from Step 1 (the one you manually created for a public resource group or the one EAS automatically created for a dedicated resource group), and then click Next.

  4. On the Logtail Configurations wizard page, configure the parameters and click Next.

    In the Input configuration section, you must configure File Path, which specifies the path of the files to collect. For more information about other parameters, see Collect text logs from Kubernetes containers in DaemonSet mode.

  5. Click Next until the configuration is complete.

Resource quotas

Container standard output

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, click Single Line - Text Logs.

    Note

    You can select a different data import method. For example, if you need to match logs using regular expressions, select Regular Expression - Text Logs. If you need to parse logs in JSON format, select JSON - Text Logs. You can also modify the configuration later.

    image

  3. Set Use Case to Host Scenarios and Installation Environment to ECS. Select the machine group that you manually created for the resource quota in Step 1, and then click Next.image

  4. In the Logtail configuration, specify the following parameters:image

    • Set File Path to /var/log/containers-stdout/{container_name}, where {container_name} is the container name. For example, to collect logs from all custom containers, you can set the path to /var/log/containers-stdout/worker*.

    • Set File Name to *.log.

  5. Click Next until the configuration is complete.

Container file logs

  1. When you deploy a service, specify the directories of the log files to collect in the JSON configuration.

    {
      "cloud": {
        "logging": {
          "paths": [
            "/home/admin/logs",
            "/home/workspace/logs",
            "/var/log"
          ]
        },
        // Other configurations are omitted.
        "networking": {
          "security_group_id": "sg-xxxxx",
          "vswitch_id": "vsw-xxxxx",
          "vpc_id": "vpc-xxxxx",
        }
      }
    }
  2. In the Import Data section, click Single Line - Text Files.

    image

  3. Set Use Case to Host Scenarios and Installation Environment to ECS. Select the machine group that you manually created for the resource quota in Step 1, and then click Next.image

  4. In the Logtail Configuration section, set File Path to a path you specified in the service JSON configuration.image

  5. Click Next until the configuration is complete.

Related documentation