1. System Logging — Overview

What is System Logging?

The operating system records events that happen on the system into log files. These records (logs) help you:

Two Logging Systems in Linux

Feature rsyslog systemd-journald
Started as syslog → rsyslog Built into systemd
Storage format Plain text files Binary (journal) file
How to read cat, tail, less, head, any text editor journalctl command only
Survives reboot? Yes (stored in /var/log/) Depends on config (default: no on RHEL, yes on Debian)
Started with Separate service Starts with systemd (PID 1)
Advantage Files are simple to read Captures logs from the very first boot second

Which Systems Use What

Distribution rsyslog journald
Rocky / RHEL Yes (both run together) Yes (both run)
Debian (default install) Not installed by default Yes

On Rocky/RHEL: both run — rsyslog saves to files, journald keeps its own journal.

On Debian: only journald by default. Install rsyslog manually:

sudo apt install rsyslog

2. rsyslog — Log Files and Configuration

Where rsyslog Stores Logs

Log files are stored in /var/log/. The most important files:

File Contents
/var/log/messages Most general system logs (equivalent to syslog on Debian)
/var/log/secure Authentication and security events (SSH logins, sudo, etc.)
/var/log/maillog Mail-related logs
/var/log/cron Scheduled task logs (cron jobs)
/var/log/boot.log Boot process logs

On Debian with rsyslog installed, the main file is /var/log/syslog instead of /var/log/messages.