Skip to content
Search Oracle Linux

    Browse this documentation

    The logging stack in practice: journald is volatile by default!, rsyslog persistence, and severity queries (measured)

    The measured truth of the OL 10 logging stack: not persistent by default, the config file has moved, which files rsyslog owns — and the baseline that puts the logging system in a “there will be something to check after an incident” state.

    Truth one: a minimal install’s journal is volatile

    Section titled “Truth one: a minimal install’s journal is volatile”
    Terminal window
    ls /var/log/journal/ 2>/dev/null || echo volatile
    # volatile ← lost at reboot!
    journalctl --disk-usage
    # Archived and active journals take up 4.9M

    Those 4.9M of logs live entirely in memory (/run/log/journal). This means one reboot evaporates every prior log — including the critical pre-crash scene (except kdump’s vmcore-dmesg, see the kdump page). This is the minimal install’s default behavior, not a malfunction.

    Three steps to persist:

    Terminal window
    mkdir -p /var/log/journal
    systemd-tmpfiles --create --prefix /var/log/journal
    systemctl restart systemd-journald
    Terminal window
    ls /etc/systemd/journald.conf # measured: absent

    OL10’s (systemd 257) defaults live at /usr/lib/systemd/journald.conf; customization goes through drop-ins:

    Terminal window
    cat > /etc/systemd/journald.conf.d/90-keep.conf <<'EOF'
    [Journal]
    Storage=persistent
    SystemMaxUse=1G
    EOF
    systemctl restart systemd-journald

    Older tutorials saying “edit /etc/systemd/journald.conf” miss on OL10 — this is systemd upstream’s config layering (/usr/lib defaults → /etc drop-in overrides).

    rsyslog: the traditional text layer’s role

    Section titled “rsyslog: the traditional text layer’s role”

    Measured: rsyslog in place with /var/log/messages active (provided with the minimal install/Server environment). The division:

    StackFormQueryWhat it captures
    journaldbinary/structuredjournalctleverything (kernel + services + stdout)
    rsyslogtextgrep/collectorsrewritten from the journal → messages and friends

    They do not conflict. Persisting journald while keeping rsyslog is the steady baseline: text for humans and legacy tools, structured for grep -j/scripts.

    Terminal window
    journalctl -u sshd -n 20 # by service
    journalctl -p err --no-pager # err and above (measured: hit the md/raid1 disk-failure record)
    journalctl --since "1 hour ago" # a time window
    journalctl -k | grep -i oom # kernel messages (OOM troubleshooting)
    journalctl -o json-pretty -n 1 # structured output (the collector format)
    journalctl --disk-usage # usage
    journalctl --vacuum-size=500M # cleanup

    A measured bonus: -p err directly hit the raid1 disk-failure record this site’s mdadm drill manufactured — the logging system and the fault drill closed the loop on the same machine.

    • Measured: the volatile default, the config-path change, the rsyslog dual stack, severity queries and disk-usage (E3);
    • Not measured: remote log forwarding (rsyslog → a central server; covered in the collector page) and journald’s compression/rate-limit parameters;
    • Sources: OL10 system logging documentation, journald.conf(5), journalctl(1).