tencent cloud

Feedback

Enabling Log Collection

Last updated: 2023-02-02 17:05:22
This document is currently invalid. Please refer to the documentation page of the product.

    Scenarios

    EKSCI provides log collection capability and supports sending the standard output logs and file logs of the containers in the cluster to CLS. It is applicable for uses who want to store and analyze the service logs in EKSCI.

    Prerequisites

    Prepare a log topic of CLS to be used as the log reporting terminal. You can view and search the logs under the log topic after reporting the logs. If there is no appropriate log topic, see Creating a log topic.

    How It Works

    Enabling log collection when creating a container instance

    Note:

    You need to enable log collection when creating the container instance.

    1. Log in to the TKE console. Click Create Instance.

    2. Configure the parameters of the container instance based on actual needs. For more information, see Creating a Container Instance. After configuration, click Next.

    3. Enable log collection on theOther Configurations page.
      Authorization is required when the log collection feature is enabled for the first time. The role TKE_QCSLinkedRoleInEKSLog will be bound to your account by default, and the default policy configured for this role is QcloudAccessForTKELinkedRoleInEKSLog. The role will have permissions such as log uploading. Select the following parameters after the feature is enabled:

      • Select the logset and log topic.
      • Select the container and configure the collection path. It supports "stdout" (indicating standard output) and absolute path, and supports *. If there are more than one collection path, separate them with ,.
        Note

        If role authorization capability is required when enabling log collection, the role bound to the instance must have the write permission on "cls:pushLog". For more information, see here. Only one role can be bound to a container instance.

    Viewing the collected logs

    1. Log in to the CLS console and click Search and Analysis in the left sidebar.
    2. On the Search and Analysis page, select the region, logset, and log topic to view logs.
    3. Click Index Configuration and enable full-text index for the cluster in the basic configuration window that pops up.
    4. Enter the search syntax, select a time range, and then click Search Analysis to search for logs.

    FAQs

    What can I do if logs are not displayed?

    If you confirm that you have reported logs but they are not displayed, please check the following:

    1. Log in to the CAM console to check if there is a TKE_QCSLinkedRoleInEKSLog role.
    2. Check if full-text index has been enabled for the log topic.
    3. If role authorization has been enabled, check if the role bound to the container instance has the permission to report logs. For specific configuration, see "Role Authorization".
    4. Check if the entity selected for the role bound to the instance is CVM.

    If the problem persists, submit a ticket to contact us.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support