Caffeinated Coder
Book an appointment
Lesson 11 · The system

Logs

A log is a diary a program keeps: one line per event, each with a time. On a Linux system that runs systemd, one service, systemd-journald, collects the lines that services print and the kernel's own messages, stamps each with the time, the unit and the process ID, files it at a priority, and stores them in the journal. Follow a three-line Python service's two lines into the journal, then read them back with journalctl, filtered by unit and by priority.

10 min9 steps5 questionsIntermediate
Fig 11 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.