Log Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=2824
Answer
Log troubleshooting means finding the right log, narrowing it to the time and source of the problem, and reading the first error rather than the last.
Remember
Note the exact time of the failure and filter to it (--since, --until). The first error often causes the later ones. Check that clocks are synchronised before correlating across hosts. If nothing is logged, raise the log level temporarily.
First checks
journalctl -b -p warning— warnings and errors since bootjournalctl -u <unit> -f— follow one unit's logls -lh /var/log— log files and sizeslogger -p user.info test— send a test message
Commands
journalctl --verifysystemctl restart systemd-journaldjournalctl --vacuum-size
Verify in this order
failure time → right log source → filtered window → first error → cause
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=2824