Viewing logs
Kernel messages can be retrieved withtalosctl dmesg command:
talosctl logs command:
talosctl logs kernel.
Container logs for Kubernetes pods can be retrieved with talosctl logs -k command:
If some host workloads (e.g. system extensions) send syslog messages, they can be retrieved with talosctl logs syslogd command.
Forwarding logs for aggregation
Talos writes logs to files in/var/log directory.
A pod running in Kubernetes can mount this directory and forward logs to a log aggregation system.
Sending logs over network
Service logs
You can enable logs sendings in machine configuration:json_lines:
msg, talos-level, talos-service, and talos-time fields are always present; there may be additional fields.
Every message sent can be enhanced with additional fields by using the extraTags field in the machine configuration:
extraTags are added to every message sent to the destination verbatim.
syslog is considered a service in Talos, and so messages/logs sent to syslog (e.g., by system extensions) are considered
service logs and will be sent to any configured remote receivers without further configuration.
Kernel logs
Kernel log delivery can be enabled with thetalos.logging.kernel kernel command line argument, which can be specified
in the .machine.installer.extraKernelArgs:
json_lines.
Sample message:
extraKernelArgs in the machine configuration are only applied on Talos upgrades, not just by applying the config.
(Upgrading to the same version is fine).
Receiving logs
If you have configure remote service logs or kernel logs on a Talos system and want to collect the logs centrally for debugging purposes you can temporarily run the netcatnc command to receive logs.
On a Linux host run the following command: