- Documentation
Torch Log Service
User Guide
Data collection
LogCollector collection
Collect container logs
Container collection overview
Collect container logs
Container collection overview
Container collection overview
TLS supports collecting container text logs and standard output from Kubernetes clusters. Both DaemonSet and Sidecar collection methods are available. This topic describes the collection methods and collection process of Kubernetes container logs.
Features
LogCollector supports collecting log files and standard output inside containers, and uploads the log data together with container metadata to the server. When collecting container logs, LogCollector offers the following capabilities:
- Supports universal container collection rules.
- You can specify which containers to collect by configuring container label and environment variable allowlist or denylist.
- Container metadata, such as names and images, is included as log fields and uploaded to TLS along with the collected log data.
- Supports specifying K8s collection rules. When a container runs in Kubernetes, LogCollector provides the following additional features.
- Support specifying containers to be collected by configuring Kubernetes Namespace name, Pod name, and workload type and name.
- Support specifying the scope of containers to be collected using Pod Label allowlists and denylists.
- Container metadata, including Namespace, Pod name, Pod unique identifier, and Pod IP address, will be uploaded as log fields to TLS.
- Supports various log collection modes such as single-line, multi-line, and separator, compatible with multiple collection configurations.
- When collecting container text logs, you can directly specify the log file path inside the container to collect log data from that path.
Collection methods
TLS provides DaemonSet and Sidecar collection methods for container logs in Kubernetes clusters.
Container log collection process
DaemonSet collection process
Follow the steps below to install LogCollector and configure container log collection rules.
- Install LogCollector in the Kubernetes cluster.
Tip
We recommend using a host group based on host identification. Set the host identification to the custom identifier configured during LogCollector installation. For steps, see Create host group (Host identification). - Create log collection configuration in the console
- TLS supports collecting text logs via DaemonSet. You can collect container text logs and container standard output from Kubernetes clusters.
Sidecar collection process
Follow the steps below to install LogCollector and configure container log collection rules.
- Install LogCollector in the Kubernetes cluster.
- We recommend using a host group based on host identification. Set the host identification to the custom identifier configured during LogCollector installation. For steps, see Create host group (Host identification).
- Create log collection configuration in the console.
- Container text logs can be collected via Sidecar. When creating the configuration, you can simply select the mode based on the text log format; you do not need to select the container logs option. For more information, see:
Last updated: 2026.04.20 16:03:51