All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Log management

Last updated:2021-05-11 10:39:26

KCE provides the log collection service within Kubernetes clusters and sends collected log data to Kingsoft Cloud Log Service (KLog). It enables you to collect, store, analyze, and present business logs, improving your Operations and Maintenance (O&M) management and online troubleshooting efficiency.

You need to manually enable the log collection service for each Kubernetes cluster. KCE deploys a log collection client in the cluster by using a DaemonSet, collects data from log sources, including container standard output logs, container file logs, and host file logs, based on your log collection rules, and sends the data to KLog for statistics and analysis.

Prerequisites

  • Resources in your cluster that are to be occupied by the log collection service are verified. The log collection service occupies 0.1 cores to 1 core of the CPU and 100 MB to 500 MB of the memory by default. You can adjust the resource occupation as required.
  • All nodes in the cluster can access KLog.

Procedure

Enable the log collection service

  1. Log in to the KCE console.
  2. In the left navigation pane, click Log Management.
  3. On the page that appears, select the region and cluster in which the log collection service is not enabled, and click Apply for install. image.png
  4. In the Enable Log Collection Service dialog box, click Active. image.png

Configure log collection rules

  1. Log in to the KCE console.
  2. In the left navigation pane, click Log Management.
  3. On the page that appears, select the region and cluster as required and click Create. image.png
  4. On the Create Log Collection Rule page, set the following parameters:
    • Rule Name: the name of the log collection rule, which must be unique in the cluster.
    • Log Type: the supported log type. Valid values: Container Standard Output, Container File Path, and Host File Path.
      • If you set Log Type to Container Standard Output, logs can be collected from the following sources:
        • All Containers: all containers in the cluster.
        • Specified Workload: containers that run specified workloads in a namespace.
      • If you set Log Type to Container File Path, logs can be collected from the following sources:
        • Log files of any specified container in the cluster
      • If you set Log Type to Host File Path, logs can be collected from the following sources:
        • Log files of any specified node in the cluster. You can add labels to the collected logs in the key-value format for subsequent analysis and classification.
    • Log Source: the source from which you collect logs. Set this parameter based on the selected log type.
    • Consumer: the log consumer. Only KLog is available. You must specify a project and a log pool for KLog.

View and update log collection rules

  1. Log in to the KCE console.
  2. In the left navigation pane, click Log Management.
  3. On the page that appears, select the region and cluster to view the configured log collection rules.
  4. To modify a log collection rule, find the log collection rule and click Edit Log Collection Rule in the Operation column to go to the rule modification page.
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback