This add-on will not be updated. If you want to use the log collection feature, please refer to Log Management. The new log collection feature supports multiple log parsing methods such as single-line, multi-line, separator, full regex, and JSON. The standard output and the file logs in the container will be sent to the Tencent CLS, which provides the search and analysis, visual application, log download and consumption, and other services.
The log collection feature is a tool provided by TKE for users to collect logs in clusters. It is used to send the logs of services in the cluster or those of files under a specific path in the cluster node to a specified Kafka topic or specified log topic of CLS.
The log collection feature needs to be manually enabled for each cluster. After this feature is enabled, the log collection Agent runs as a Daemonset in the cluster. Users can configure the sources and consumers of logs based on the log collection rules. The log collection Agent collects logs from the configured source and sends these logs to the consumer specified by users. To use the log collection feature, you must ensure that nodes in the Kubernetes cluster can access the log consumer.
|Kubernetes Object||Type||Required Resources||Namespaces|
|log-collector||DaemonSet||0.3 core CPU and 250 MB memory for each node||kube-system|
Log collection feature is applicable to users who need to store and analyze service logs in the Kubernetes cluster. Users can collect logs in the cluster by configuring log collection rules and can send collected logs to a specified topic of Kafka or to a specified log topic of CLS for consumption by other infrastructures of users.
Log in to the CLS console and select Log Search in the left sidebar. Select the log topic configured in the log rule in the Logset and Log Topic drop-down list, as well as the time period for which to search logs, and click Search and Analysis to view the event data, as shown in the following figure:
You need to enable the full-text index for the log topic to search for the logs.