Logs in Linux: journalctl and /var/log
Updated July 3, 2026
journalctl reads the system journal that systemd keeps; many services also write text logs under /var/log.
Common cases
journalctl -u nginx # one service's logs
journalctl -f # follow new entries (like tail -f)
journalctl -b # logs since the last boot
journalctl --since today # today's logs
sudo tail -f /var/log/syslog # an old-style text log
dmesg # kernel messagesHow it works: the journal and text files
systemd keeps its own journal in a binary format - that is what
journalctlreads, so a plaincatwill not work on it. The journal is easy to filter: by service (-u), by time (--since), by priority (-p err). Many programs still write text files under/var/log(syslog,auth.log, nginx logs) - you read those with the usualtail,less,grep. Kernel messages live apart and are shown bydmesg.
In the book
This topic is covered in full in the chapter Logging and journald.