- Documentation
Torch Log Service
User Guide
Data collection
LogCollector collection
general reference
Relation between container standard output and log levels
general reference
Relation between container standard output and log levels
Relation between container standard output and log levels
The log write path for applications inside a container is determined by the log framework configuration it used. The log level (such as info or error) is independent of container standard output (stdout) or error output (stderr) type.
- If the log framework calls os.Stdout, the log is written to the container's standard output (stdout).
- If the log framework calls os.Stderr, the log is written to the container's standard error output (stderr).
Notice
If the logging framework configuration is unclear, it is recommend to collect both stdout and stderr.
View the log write pathway based on framework configuration
Taking a Golang application as an example:
Logger is configured with logger.SetOutput(os.Stderr), so all logs (including info and error levels) are written to standard error output (stderr).
View the log write pathway based on log content
Taking the Containerd container runtime as an example:
Check the /var/log/pods/<namespace>_<pod-name>_<pod-uid>/<container-name>/0.log log file. In the file, the stderr label indicates that logs are written to the standard error output (stderr).
Last updated: 2025.12.15 17:27:03