journalctl

The command that reads the systemd journal, where services on a Linux host write their logs.

In more detail

It can filter by service, time and priority, and follow new entries as they arrive. The -u option picks one service, --since limits output to a time window, -b limits it to the current boot and -p err shows errors and worse. Starting with a narrow time window and one service keeps the output manageable.

Examples

journalctl -u kubelet -n 5 --no-pager
journalctl -u kubelet -n 5 --no-pager   # the kubelet's own log on a Kubernetes node
unit=worker since=boot pri=err msg=timeout models a query by unit, boot and priority.

Related terms

Taught in

References

Certification courses