Skip to content
Search Fedora

    Browse this documentation

    journalctl in depth: persistence, filtering, quotas, and vacuum

    Fedora 45’s journald is nearly zero-config: persistence is on by default. This page covers everything daily log hunting needs.

    Terminal window
    ls -d /var/log/journal && echo persistent
    journalctl --disk-usage
    journalctl --list-boots | wc -l

    Measured on an F45 box after a few days:

    persistent
    Archived and active journals take up 64M in the file system.
    6

    Three facts: logs are on disk (survive reboot), currently 64 MiB, six boots recorded. The config lives in /usr/lib/systemd/journald.conf (every vendor default commented out; Fedora does not ship a copy under /etc — configure via drop-ins, below).

    Filtering: the three dimensions you actually use

    Section titled “Filtering: the three dimensions you actually use”
    Terminal window
    # by unit
    journalctl -u sshd --since today
    # by priority (emerg..debug; err and above)
    journalctl -p err -b
    # by time
    journalctl --since "1 hour ago" --until "10 min ago"

    Measured on an F45 box: -u sshd --since today yields 316 lines, -p warning 384 — the filtered count is the readable one.

    The everyday debugging combo:

    Terminal window
    journalctl -u nginx -p err --since "24 hours ago" --no-pager | tail -20

    Other frequent flags: -b (this boot), -b -1 (previous boot — see why it died), -f (follow, like tail -f), --no-pager (for scripts).

    Terminal window
    journalctl -u sshd -o short-iso --no-pager | tail -1
    2026-10-29T07:25:27+00:00 fd45-repo sshd-session[8068]: pam_unix(...)

    short-iso gives second-precision ISO timestamps and greps cleanly. For programs, use JSON:

    Terminal window
    journalctl -u sshd -o json --no-pager | tail -1
    {"SYSLOG_TIMESTAMP":"Oct 29 07:25:27 ","_SYSTEMD_INVOCATION_ID":"609ee5064af24fa", ...}

    Every field (__MONOTONIC_TIMESTAMP, _PID, MESSAGE, …) is present; jq '.MESSAGE' extracts the payload.

    journald self-limits by default (roughly 10% of disk, capped at 4 GiB). To set it explicitly:

    Terminal window
    sudo mkdir -p /etc/systemd/journald.conf.d
    printf "[Journal]\nSystemMaxUse=200M\n" | \
    sudo tee /etc/systemd/journald.conf.d/size.conf
    sudo systemctl restart systemd-journald

    Measured: after restart the service is active, and oversized journals rotate away in the background. For retention time use MaxRetentionSec (vendor default 0 = unlimited).

    Quotas are a standing policy; --vacuum-* is a one-shot action:

    Terminal window
    sudo journalctl --vacuum-size=50M # keep 50M
    sudo journalctl --vacuum-time=7d # keep 7 days
    sudo journalctl --vacuum-files=5 # keep 5 archives

    Measured on a 64M box, --vacuum-size=50M reported “freed 0B” — below the target it deletes nothing. That is correct behaviour, not a malfunction.

    SymptomCause
    logs gone after rebootStorage=volatile, or /var/log/journal deleted; verify with ls -d /var/log/journal
    journald.conf change had no effectedited the vendor file, or no restart of systemd-journald
    --vacuum-size deleted nothingcurrent usage below the target, expected
    -f shows nothing for your servicewrong unit name; confirm with systemctl list-units | grep name
    endless duplicate linesthe app logs to stdout and journald collects it too; lower app log level
    journal fills the diskno SystemMaxUse set; add the drop-in above