Running plain journalctl with no arguments drops you at the start of a multi-month binary log inside a pager, which is rarely what you want during an incident. Once you internalize five or six flags, though, journalctl is much faster than grepping rotated text files under /var/log.

1. Filter by service and follow live

Nine times out of ten, you care about a single unit. Use -u for the unit name, -n for the last N lines, and -f to tail new entries:

journalctl -u nginx -n 100 --no-pager
journalctl -u myapp -f

You can pass -u multiple times to interleave logs from two related services—for example, your web server and your app—in exact chronological order:

journalctl -u caddy -u myapp -f

If your terminal wraps long JSON lines awkwardly, add -o cat to strip the timestamp and hostname prefix when piping to jq, or -o short-iso for readable ISO-8601 timestamps. When you want to jump straight to the end of a unit's log inside the pager, add -e (journalctl -xeu myapp).

2. Slice by time window

--since and --until accept both relative times ("1 hour ago", "today", "yesterday") and ISO timestamps:

journalctl -u myapp --since "2 hours ago"
journalctl --since "2025-05-07 22:00:00" --until "2025-05-07 22:30:00"

Notice that timestamps are interpreted in the server's local timezone unless you append UTC. Setting your servers to UTC avoids DST confusion entirely when comparing logs across machines.

3. Inspect the previous boot after a crash or reboot

If a machine unexpectedly rebooted or panicked, logs from before the reboot are still in the journal as long as persistent storage is enabled. List recorded boots and inspect the previous one with -b -1:

journalctl --list-boots
journalctl -b -1 -p err..emerg --no-pager

Adding -k restricts output to kernel messages (dmesg), which is where you will see OOM killer events (Out of memory: Killed process) or disk I/O errors right before a crash:

journalctl -k -b -1 | grep -i -E "oom|killed|error"

If journalctl --list-boots only shows the current boot, check that /var/log/journal exists or that Storage=persistent is set in journald.conf.

4. Filter by log priority

When you want to scan the whole system for real problems without informational chatter, filter by syslog priority. Priority levels run from 0 (emerg) to 7 (debug):

journalctl -p err -b --no-pager

-p err shows everything at severity err or worse (err, crit, alert, emerg) since the current boot.

5. Search with grep directly inside journalctl

Recent versions of journalctl support -g (--grep) to filter messages with a PCRE pattern before formatting output, which is noticeably faster than piping megabytes to grep:

journalctl -u ssh -g "Invalid user" --since "24 hours ago"

6. Keep the journal from filling your disk

On small VPS disks (20–40 GB), an uncapped journal can quietly grow to several gigabytes. Check current disk usage first:

journalctl --disk-usage

You can reclaim space immediately without restarting anything:

sudo journalctl --vacuum-size=500M
sudo journalctl --vacuum-time=14d

To make the cap permanent, drop a small drop-in config into /etc/systemd/journald.conf.d/ so package updates never overwrite /etc/systemd/journald.conf:

sudo mkdir -p /etc/systemd/journald.conf.d
sudo tee /etc/systemd/journald.conf.d/size.conf > /dev/null <<'EOF'
[Journal]
Storage=persistent
SystemMaxUse=500M
MaxRetentionSec=1month
EOF

sudo systemctl restart systemd-journald

With a 500 MB cap, persistent storage, and a one-month retention limit, you keep enough history to debug real issues without ever waking up to a full root filesystem. One last tip: add your deploy user to the systemd-journal group (sudo usermod -aG systemd-journal deploy) so you can inspect system logs without typing sudo every time.