Common Linux Log Files in /var/log
Learn where Linux system, authentication, kernel, service, package, mail, desktop, print, boot, and scheduled-task logs are stored and how to inspect them safely.
Linux logs record events such as system startup, authentication attempts, hardware detection, service activity, package changes, and application errors. Many traditional text-based logs are stored in /var/log and its subdirectories.
The exact files available depend on the distribution, installed software, logging daemon, and local configuration. A missing file is not automatically a fault: the same event may be stored under another filename or only in the systemd journal.
How Linux logging is organized
A log destination is the place where a logging system stores an event. Traditional syslog-based systems classify messages by a facility, which describes the source category, and a severity, which describes importance.
- Facility: a category such as
auth,cron,daemon,kern,mail, oruser. - Severity: a priority ranging from emergency and alert through critical, error, warning, notice, informational, and debug.
rsyslog and syslog-ng are syslog implementations that can route messages to files, remote hosts, or other destinations. systemd-journald collects structured entries that are queried with journalctl.
Logs can be:
- Persistent: stored on disk, commonly below
/var/log, and retained across reboots. - Volatile: stored in memory or a temporary filesystem, so entries can disappear after shutdown or reboot.
- Journal-based: stored and queried by
systemd-journald. A journal may be persistent or volatile depending on its configuration.
A system can use journald alone, a traditional syslog daemon alone, or both. When both are active, journald may forward selected entries to rsyslog or syslog-ng, which then writes selected messages to files. Routing rules determine which message reaches which destination.
Common Linux log files and directories
| Path or pattern | Typical purpose | Common distributions or conditions | Typical events | Equivalent or alternate source |
|---|---|---|---|---|
/var/log/messages | General system messages | Common on Red Hat-family systems | System, service, and daemon messages according to routing rules | /var/log/syslog or the journal |
/var/log/syslog | General system messages | Common on Debian-family systems | Broad informational, warning, and error messages | /var/log/messages or the journal |
/var/log/kern.log | Kernel messages | Systems configured to write kernel messages to a file | Hardware detection, drivers, device errors, filesystem events, and boot diagnostics | dmesg or journalctl -k |
/var/log/auth.log | Authentication and authorization | Common on Debian-family systems | SSH, login, PAM, sudo, successful logins, and failed attempts | /var/log/secure or a service journal |
/var/log/secure | Authentication and authorization | Common on Red Hat-family systems | SSH, PAM, sudo, account restrictions, and privilege events | /var/log/auth.log or a service journal |
/var/log/cron | Cron daemon activity | Some distributions | Scheduler invocations and cron daemon messages | General syslog files or the systemd journal |
/var/log/boot.log | Boot-time service messages | Some systems | Service startup and hardware initialization messages | journalctl -b |
/var/log/daemon.log | Background service processes | Some syslog configurations | Messages categorized with the daemon facility | Application files or the journal |
/var/log/user.log | User-level syslog facility messages | Some syslog configurations | Messages explicitly categorized as user-level | General syslog files or the journal |
/var/log/dpkg.log | dpkg package activity | Debian-derived systems | Package installation, removal, upgrade, and configuration | Higher-level package-manager history |
/var/log/yum.log | YUM activity | Older or Red Hat-family systems | Package installation, removal, and updates | DNF logs or package-manager history |
/var/log/Xorg.0.log or /var/log/Xorg.X.log | X.Org display-server logging | Systems using X.Org and configured for file logging | GPU drivers, monitors, display, and input devices | Display-manager, Wayland, or journal logs |
/var/log/cups/ | CUPS printing logs | Systems using CUPS | Jobs, queues, permissions, printers, drivers, and filters | CUPS service journal |
/var/log/maillog | Mail-transfer-agent logging | Common on some Red Hat-family systems | Submission, delivery, rejection, relay, and queue events | /var/log/mail.log or the journal |
/var/log/mail.log | Mail-transfer-agent logging | Common on some Debian-family systems | Mail service activity and delivery status | /var/log/maillog or the journal |
Distribution-specific names
| Event category | Debian-family common path | Red Hat-family common path | Journal-based alternative | Notes |
|---|---|---|---|---|
| General system messages | /var/log/syslog | /var/log/messages | journalctl | Routing rules determine the precise contents. |
| Authentication and privilege events | /var/log/auth.log | /var/log/secure | journalctl, often filtered by SSH or login services | Includes successful and failed events when configured. |
| Kernel events | /var/log/kern.log where configured | Often general messages or journal entries | journalctl -k | dmesg reads the kernel message buffer. |
| Scheduled-task activity | Often /var/log/syslog | Often /var/log/cron | journalctl -u cron or the relevant scheduler unit | Names and units vary. |
| Mail service events | /var/log/mail.log | /var/log/maillog | The MTA's service journal | Contents depend on Postfix, Sendmail, or another MTA. |
System-wide and kernel messages
/var/log/messages and /var/log/syslog
/var/log/messages is a broad system-message file commonly found on Red Hat-family systems. Depending on rsyslog or syslog-ng rules, it may contain messages from the kernel, services, and daemons. Debian-family systems commonly use /var/log/syslog for a similar purpose.
These files are useful when you know that something happened but do not yet know which service produced it. Search around the event time and look for repeated warnings or errors rather than treating one isolated message as the entire diagnosis.
/var/log/kern.log, dmesg, and journalctl -k
/var/log/kern.log is a file destination for kernel messages when the system is configured to write one. Kernel messages help diagnose device discovery, module loading, driver failures, disk or filesystem errors, and hardware problems during boot.
sudo less /var/log/kern.log
dmesg | less
journalctl -k
dmesg views the kernel message buffer, while journalctl -k queries kernel entries collected by journald. They may not contain exactly the same history or formatting as a persistent file.
Authentication and authorization logs
On Debian-family systems, /var/log/auth.log commonly records login activity, SSH connections, PAM decisions, sudo authorization, and account-related events. On Red Hat-family systems, the comparable file is commonly /var/log/secure.
sudo grep -Ei "failed|failure|invalid|accepted|sudo" /var/log/auth.log
sudo grep -Ei "failed|failure|invalid|accepted|sudo" /var/log/secure
journalctl -u sshd
Successful and failed authentication entries answer different questions. A failed password attempt may show the account and source address; a later successful login from the same address may be important in a security investigation. Interpret entries with their timestamps, source addresses, account names, and related configuration changes.
These logs can contain usernames, IP addresses, command activity, and other sensitive information. Read and share them using least-privilege practices.
Scheduled-task logs
cron is a time-based scheduler for recurring commands. /var/log/cron is a common record of cron daemon activity on some distributions, but cron messages may instead be routed to /var/log/syslog, /var/log/messages, or the systemd journal.
sudo grep -i cron /var/log/cron
sudo grep -i cron /var/log/syslog
journalctl -u cron
A scheduler entry proves that cron attempted to invoke a job; it does not prove that the command completed successfully. Also inspect the job's own redirected standard output and error output.
15 2 * * * /usr/local/bin/backup.sh >>/var/log/backup.log 2>&1When diagnosing a failed task, check the user running it, its limited environment and PATH, permissions, credentials, network dependencies, and the destination of its output.
Boot logs and service logs
Boot diagnostics
/var/log/boot.log may contain boot-time service messages, but it is often incomplete on modern systemd systems. Use the journal for the complete view of a boot:
journalctl -b
journalctl -b -p warning
journalctl -u SERVICE_NAME
Boot records help connect hardware initialization and service startup failures to a particular boot. If the current boot is not the one of interest, inspect retained previous boots with journalctl --list-boots.
Daemon and application destinations
A daemon is a background service process. /var/log/daemon.log may receive messages categorized with the daemon facility, but a service can instead have a dedicated application file, write to another facility, or retain messages only in journald.
The relationship is:
- A daemon runs under a process and often under a systemd unit name.
- The daemon or its service manager emits log messages.
- journald, rsyslog, or syslog-ng receives and classifies them.
- Routing configuration sends them to a file, the journal, a remote collector, or several destinations.
systemctl status SERVICE_NAME
journalctl -u SERVICE_NAME
sudo find /var/log -maxdepth 2 -type f | sort/var/log/user.log, where present, is a destination for messages using the user syslog facility. It does not necessarily contain every action performed by every local user.
Package-management logs
On Debian-derived systems, /var/log/dpkg.log records low-level package installation, removal, upgrade, and configuration activity. On older or Red Hat-family systems, /var/log/yum.log may record YUM activity. DNF is the modern replacement for YUM on many systems, and its log location and history mechanisms can differ.
sudo less /var/log/dpkg.log
sudo less /var/log/yum.log
sudo find /var/log -iname '*dnf*' -o -iname '*yum*'Compare package timestamps with the first occurrence of a service failure. This often identifies a package update, configuration change, or dependency change that preceded a regression.
Display, printing, and mail logs
Graphical display logs
/var/log/Xorg.0.log and numbered files matching /var/log/Xorg.X.log are X.Org display-server logs where file logging is configured. They can reveal GPU-driver problems, monitor detection failures, display initialization errors, and input-device issues.
Wayland sessions, display managers, and newer systemd configurations may use different files or the journal, so an absent Xorg log is normal on a Wayland-only system.
CUPS printing logs
CUPS means Common Unix Printing System. Its logs are commonly stored in /var/log/cups/. Check them for jobs that remain queued, printer connectivity problems, access requests, permission errors, and driver or filter failures.
sudo ls -lah /var/log/cups/
sudo grep -RniE "error|failed|denied|filter" /var/log/cups/Mail logs
/var/log/maillog and /var/log/mail.log are common paths for mail-transfer-agent logs. An MTA, such as Postfix or Sendmail, transfers mail between systems. The actual contents depend on the installed MTA and its configuration.
Mail logs can trace message submission, delivery, rejection, relay decisions, retries, and queue activity. Search using a message identifier, sender, recipient, or timestamp.
Reading and filtering logs safely
Start by listing what actually exists:
ls -lah /var/log
sudo find /var/log -maxdepth 2 -type f | sortUse less for interactive reading, tail for recent entries, and tail -F to follow a file across rotation or replacement:
sudo less /var/log/messages
sudo tail -n 100 /var/log/auth.log
sudo tail -F /var/log/messagesSearch without changing the source file:
sudo grep -i "failed" /var/log/auth.log
sudo grep -Ei "error|fail|denied" /var/log/messages
sudo awk '/2026-08-17/ {print}' /var/log/syslogTraditional logs may begin with a month, day, and time rather than a year. For reliable date-aware filtering, identify the file's timestamp format first, account for year boundaries, and prefer journal filters when possible:
journalctl --since "2026-08-17 00:00:00" --until "2026-08-18 00:00:00"
journalctl -u sshd --since todayRead each line as structured evidence. Look for the timestamp, hostname, process or service name, process ID when present, severity, message, and recurring pattern. Correlate related entries instead of relying on a single line.
Log rotation
logrotate rotates, compresses, retains, and removes old log files according to policy. Rotation prevents uncontrolled disk usage while preserving recent history.
Policies are commonly defined in /etc/logrotate.conf and individual files under /etc/logrotate.d/. A policy can specify daily, weekly, or monthly rotation, a retention count, compression, and a post-rotation action such as signaling or reopening a service's log.
sudo cat /etc/logrotate.conf
sudo ls -lah /etc/logrotate.d
sudo logrotate -d /etc/logrotate.confFor example, an active /var/log/messages may become /var/log/messages.1, then older numbered files. Other policies use date suffixes. Older files may be compressed:
| Active log | Possible rotated names | Compressed form | Viewing command | Retention behavior |
|---|---|---|---|---|
/var/log/messages | messages.1 or date-suffixed files | messages.1.gz | zless, zgrep, or zcat | Policy-specific count and age |
/var/log/auth.log | auth.log.1 or date-suffixed files | auth.log.1.gz | zless /var/log/auth.log.1.gz | Policy-specific count and age |
/var/log/syslog | syslog.1 or date-suffixed files | syslog.1.gz | zgrep -i "error" /var/log/syslog*.gz | Policy-specific count and age |
zless /var/log/messages.1.gz
zgrep -i "error" /var/log/messages*.gzA forced rotation is disruptive to filenames, retention state, and sometimes service behavior. Use it only in a controlled environment when you understand the policy:
sudo logrotate -f /etc/logrotate.conf
Verifying logging services and rules
When a file is absent, first determine which collection system is active:
systemctl status rsyslog
systemctl status systemd-journald
systemctl status syslog-ngThen inspect /var/log, query the journal, and review the relevant rsyslog or syslog-ng routing configuration. A missing expected file can result from a different distribution convention, an uninstalled service, no events yet, journal-only retention, or a changed routing rule.
Do not assume that every message is written to every file. Facility, severity, service configuration, forwarding rules, and rotation policy all affect what is available.
Practical troubleshooting workflows
Repeated SSH login failures
- Open
/var/log/auth.logon Debian-family systems or/var/log/secureon Red Hat-family systems. - Search for failed and accepted entries, recording timestamps, accounts, and source addresses.
- Query the SSH service journal with
journalctl -u sshdwhen file logs are absent. - Correlate a successful follow-up login with earlier failures and configuration changes.
Hardware or driver failure after startup
- Check
/var/log/kern.logif present. - Compare
journalctl -kanddmesgfor device, module, driver, and I/O messages. - Search around the boot time and identify repeated errors rather than harmless detection notices.
Cron task did not produce its result
- Check
/var/log/cron,/var/log/syslog,/var/log/messages, or the journal for scheduler invocation. - Inspect the command's redirected stdout and stderr or local mail output.
- Run the command as the same user with a minimal environment and verify permissions, paths, credentials, and dependencies.
Package update preceded a service failure
- Inspect
/var/log/dpkg.log,/var/log/yum.log, or applicable DNF logs. - Record the installation or upgrade time.
- Compare it with the service's first error in its file or journal.
Print job remains queued
- Inspect
/var/log/cups/. - Search for job-processing, connectivity, permission, driver, and filter errors.
- Compare the CUPS timestamp with queue status and the printer service journal.
Boot failure is missing from boot.log
- Use
journalctl -bfor the current boot. - Use
journalctl -u SERVICE_NAMEfor the failing unit. - Check application-specific logs because boot.log may contain only a subset of startup messages.
- Compare with a previous retained boot when useful.
Logs consume disk space
- Measure large files and directories under
/var/log. - Review logrotate policies and retention counts.
- Search recent logs for an application producing repeated errors.
- Check journal disk usage and retention configuration as well as file-based logs.
Exam-relevant notes
/var/log/messagesis commonly associated with broad system messages on Red Hat-family systems;/var/log/syslogis a common Debian-family counterpart./var/log/auth.logand/var/log/secureare distribution-family alternatives for authentication and privilege events.journalctl -bis often more complete than/var/log/boot.logon systemd systems.journalctl -kanddmesgare important kernel-log inspection tools.- A cron invocation entry does not prove that the scheduled command succeeded.
dpkg.logrecords Debian-family low-level package activity; YUM is older, while DNF is common on modern Red Hat-family systems.- Log filenames are consequences of configuration, not universal guarantees.
- Rotation limits disk use and commonly creates numbered or compressed historical files.