Use it to find application and system log files, or when /var/log fills the disk.
/var/log
/var/log holds text log files: syslog or messages (general), auth.log or secure (logins, sudo), kern.log, dmesg, and per-application directories (nginx/, apache2/ or httpd/).
1. ls -lt /var/log | head — recently written files.
2. Logins/sudo: auth.log or secure.
3. du -sh /var/log/* | sort -h | tail — biggest.
4. Large file → rotation configured? Debug level on?
5. tail -f <file> while reproducing.
service or rsyslog writes to a file → logrotate rotates and compresses → old files removed
For Logging → /var/log, continue with the first unproven Topic check: Identify the owning producer/config and whether the log path is direct, via syslog or symlinked/mounted elsewhere. If that boundary is healthy, advance to the adjacent check: Record filesystem, inode, size, ownership, permissions and timestamps for the exact file. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
producer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlation
Healthy evidence: the expected writer targets the intended current inode with correct permissions, fresh workload events append as expected, rotation handoff is sound, and disk usage matches visible/open files.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Identify the responsible producer/config and whether the log path is direct, via syslog or symlinked/mounted elsewhere.
- Record filesystem, inode, size, ownership, permissions and timestamps for the exact file.
- Check open file descriptors when rotation, deletion or unexpected disk use is involved.
- Verify the original workload creates the expected new record in the intended current log destination.
Verification chain. producer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlation
Step 3 Commands Verify boundary
ls -lh /var/log
sudo tail -f /var/log/auth.log
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: operators tail an old rotated inode, assume filenames are universal across distributions, ignore deleted-open files, or treat file modification as evidence of complete collection.
Step 5 Common mistakes Narrow the fault
- Reading only one log file.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
File names differ by family: Debian uses syslog and auth.log, RHEL messages and secure. Use tail -f to follow and grep/less to search. A full /var/log usually means a log without rotation or a debug level left on.
journalctl -b -p warning— warnings and errors since bootjournalctl -u <unit> -f— follow one unit's logls -lh /var/log— log files and sizeslogger -p user.info test— send a test message
ReferenceWhat it is1 section · depth on demand
Core model
Map a file back to its writer and rotation policy. Verify path, symlink/mount context, permissions, inode/device, current writer file descriptor and timestamp semantics. When a log rotates, distinguish pathname from the inode still held open by a process.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
A file under /var/log shows only data persisted to that inode/path at observed times, but it does not show collector completeness, current writer identity, causation or remote retention.
/var/log owns conventional persistent log-file layout and file/inode evidence.
In depth
/var/log: what's where and how to keep it under control
The hier(7) manual page describes /var/log as the place for miscellaneous log files. On systemd systems, it also holds the persistent journal (/var/log/journal). Most text logs there are written by rsyslog and by applications that log to files.
Common files
| File | Debian / Ubuntu | RHEL family |
|---|---|---|
| General system log | /var/log/syslog | /var/log/messages |
| Authentication, sudo, SSH | /var/log/auth.log | /var/log/secure |
| Kernel | /var/log/kern.log | Included in messages |
| Package operations | /var/log/apt/history.log, /var/log/dpkg.log | /var/log/dnf.log, dnf history |
| Boot messages | journalctl -b | journalctl -b, /var/log/boot.log |
| Login records (binary) | /var/log/wtmp, /var/log/btmp, /var/log/lastlog | The same |
| Audit | — | /var/log/audit/audit.log |
| Web servers | /var/log/nginx/, /var/log/apache2/ | /var/log/nginx/, /var/log/httpd/ |
Binary login records
| File | Read with |
|---|---|
| wtmp (successful logins) | last |
| btmp (failed logins) | lastb |
| lastlog | lastlog |
When /var/log fills up
| Step | Command |
|---|---|
| Find the biggest files | du -ah /var/log | sort -h | tail |
| Journal size | journalctl --disk-usage |
| Deleted but still open | lsof +L1 /var/log |
| Free space from an open file | Truncate it (: > file), don't rm it |
| Fix the cause | logrotate configuration, application log level, journald limits |
A deleted log file that a process still has open keeps using disk space until the process closes it. rm doesn't free anything in that case. Truncating the file, or restarting the process, does.
host$ sudo du -ah /var/log 2>/dev/null | sort -h | tail -4
612M /var/log/nginx/access.log
1.1G /var/log/nginx
1.9G /var/log/journal
3.4G /var/log
host$ sudo lsof +L1 2>/dev/null | grep /var/log
nginx 1204 www-data 5w REG 253,0 2147483648 0 1835210 /var/log/nginx/access.log.1 (deleted)
host$ sudo systemctl reload nginx
host$ last -n 3
host$ sudo lastb -n 5
host$ sudo grep -c "Failed password" /var/log/auth.log
Reading the lsof output
nginx still holds a 2 GiB rotated log open, which someone deleted. The space returns once nginx reopens its logs. A reload does that, as the next line shows. Properly configured log rotation signals the service itself, so this situation doesn't arise.
Documented example, not captured output.
How it works at runtime
/var/log is part of Logging → /var/log. /var/log is the conventional filesystem namespace for persistent text and application logs, but its contents are distribution- and service-dependent and may coexist with or be absent in journal-centric systems; file presence, inode identity, ownership, rotation and open-file state matter when proving what is actually being written.
The journal is indexed by boot, unit, PID and structured fields; text files under /var/log are distribution/service dependent.
Topic-specific state model. /var/log is the conventional filesystem namespace for persistent text and application logs, but its contents are distribution- and service-dependent and may coexist with or be absent in journal-centric systems; file presence, inode identity, ownership, rotation and open-file state matter when proving what is actually being written.
Technical metadata. Host/distribution/systemd/rsyslog versions, boot ID, monotonic/realtime timestamp and timezone, NTP/clock state where relevant, producer binary/service/unit/PID/UID, logging transport/API, journal transport/facility/severity/priority, syslog source/destination/transport, file path/device/inode/ownership/permissions, journald storage/rate limits/retention, rsyslog input/ruleset/action/queue, logrotate rule/state/inode handoff, forwarding destination/receiver status, query filters, correlation ID/request ID and original workload result.
Interpretation rule. - Expected filename missing ≠ logging is disabled; the service may use the journal or another path.
- Path exists ≠ current process is writing that inode.
- File mtime changed ≠ all expected events were captured.
- Deleting/truncating a log ≠ disk space is reclaimed if a process still holds the inode open.
Quick reference
Common files in /var/log:
| File | RHEL family | Debian/Ubuntu |
|---|---|---|
| General system | messages | syslog |
| Authentication | secure | auth.log |
| Kernel | (journal) / messages | kern.log |
| Package manager | dnf.log | apt/history.log, dpkg.log |
| Boot | boot.log | (journal) |
| Audit | audit/audit.log | audit/audit.log |
| Login history | wtmp, btmp, lastlog (binary) | same |
last -n 20; lastb | head # successful / failed logins
tail -F /var/log/secure
Some minimal installs only have the journal — /var/log/messages exists only if rsyslog is installed.
Limits and how it fails
Primary failure point. A file under /var/log shows only data persisted to that inode/path at observed times, but it does not show collector completeness, current writer identity, causation or remote retention.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Rotation policy must match daemon reopen behavior.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Logging → /var/log. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://systemd.io/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
/var/log operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for /var/log.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | /var/log is the conventional filesystem namespace for persistent text and application logs, but its contents are distribution- and service-dependent and may coexist with or be absent in journal-centric systems; file presence, inode identity, ownership, rotation and open-file state matter when proving what is actually being written. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + boot ID + clock/timezone + event → identify producer/process → identify logging API/socket/file → verify collector receipt → inspect filtering/rate-limit → prove persistence/inode → verify rotation/retention → verify forwarding/remote receipt if required → query exact time/source → correlate with original workload. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | producer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlation | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | A file under /var/log proves only data persisted to that inode/path at observed times; it does not prove collector completeness, current writer identity, causation or remote retention. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux logging evidence can establish this proof path: producer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlation | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured producer, collection, persistence, retention, forwarding, query or workload scope. A file under /var/log proves only data persisted to that inode/path at observed times; it does not prove collector completeness, current writer identity, causation or remote retention. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: reproduce one exact event, align clock/boot/source identity, trace it through collection and storage, then verify retention/forwarding/query scope and independently repeat the original workload. | Continue to the next unresolved boundary while preserving the original test condition. |
/var/log · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | /var/log |
|---|---|
| Topic path | Logging → /var/log |
| Runtime state | /var/log is the conventional filesystem namespace for persistent text and application logs, but its contents are distribution- and service-dependent and may coexist with or be absent in journal-centric systems; file presence, inode identity, ownership, rotation and open-file state matter when proving what is actually being written. |
| Fast checks | - Identify the owning producer/config and whether the log path is direct, via syslog or symlinked/mounted elsewhere. - Record filesystem, inode, size, ownership, permissions and timestamps for the exact file. - Check open file descriptors when rotation, deletion or unexpected disk use is involved. - Verify the original workload creates the expected new record in the intended current log destination. |
| Verification chain | producer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlation Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | A file under /var/log proves only data persisted to that inode/path at observed times; it does not prove collector completeness, current writer identity, causation or remote retention. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |