systemd-journald
Cheat sheet · https://pcornel.dk/topic.php?topic=364
Answer
systemd-journald collects the output of every service, syslog messages and kernel messages into an indexed journal, queried with journalctl.
Remember
The journal survives a reboot only if /var/log/journal exists. Old entries are removed by size limits, and bursts are dropped by rate limiting. journalctl starts at the oldest entry: filter by unit, boot and time. A service writing to its own log file is not in the journal.
First checks
journalctl -u <unit> -b— one unit, this boot.journalctl -b -1 -p err— errors from the previous boot.journalctl --since "1 hour ago"— a time window.journalctl -k— kernel messages.journalctl --list-boots— which boots the journal still holds.journalctl --disk-usage— space used.
Commands
journalctl -u <unit> --since '<time>'- Service-specific journal entries in a time window.
journalctl -u <unit> --since "-1h"- Query systemd journal.
journalctl -b -u <unit> --since ...journalctl --disk-usagejournalctl --vacuum-size=1Gjournalctl --verifyjournalctl --rotatejournalctljournalctl -u nginxjournalctl -bjournalctl -p errjournalctl --since "1 hour ago"journalctl -fjournalctl -kjournalctl -u nginx -b -p warningjournalctl --vacuum-time=2weeks
Verify in this order
service writes to output or syslog → journald receives it → not dropped by rate limit → stored (volatile or persistent) → still within size and age limits → found by the right unit, boot and time filter
Where it usually breaks
First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=364