Apply for Free VPS

Read system logs with journalctl

Updated 27 Nov 2026 troubleshooting logs

Filter the system journal by service, time and severity.

Recent messages

sudo journalctl -n 100 --no-pager
sudo journalctl -f                      # follow live

One service

sudo journalctl -u ssh -n 50            # the unit is "sshd" on AlmaLinux and Rocky
sudo journalctl -u nginx --since today

By time and severity

sudo journalctl --since "2 hours ago"
sudo journalctl -p err -b               # errors since the last boot
sudo journalctl -b -1                   # the previous boot, if logs are persistent

Kernel messages

sudo journalctl -k | grep -i -E "out of memory|i/o error"

Keep logs across restarts

sudo mkdir -p /var/log/journal
sudo systemctl restart systemd-journald

Control the size

journalctl --disk-usage
sudo journalctl --vacuum-size=500M

To make a limit permanent, set SystemMaxUse=500M in /etc/systemd/journald.conf and restart the journal service.

Application logs often live in /var/log; see log rotation.

Was this helpful?

Report outdated or incorrect information