Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

/var/log

Direct answer

/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/).

When to use this

Use it to find application and system log files, or when /var/log fills the disk.

First 30 seconds

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.

Operational verification

service or rsyslog writes to a file → logrotate rotates and compresses → old files removed

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to find application and system log files, or when /var/log fills the disk.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • journalctl -b -p warning — warnings and errors since boot
  • journalctl -u <unit> -f — follow one unit's log
  • ls -lh /var/log — log files and sizes
  • logger -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

FileDebian / UbuntuRHEL family
General system log/var/log/syslog/var/log/messages
Authentication, sudo, SSH/var/log/auth.log/var/log/secure
Kernel/var/log/kern.logIncluded in messages
Package operations/var/log/apt/history.log, /var/log/dpkg.log/var/log/dnf.log, dnf history
Boot messagesjournalctl -bjournalctl -b, /var/log/boot.log
Login records (binary)/var/log/wtmp, /var/log/btmp, /var/log/lastlogThe same
Audit—/var/log/audit/audit.log
Web servers/var/log/nginx/, /var/log/apache2//var/log/nginx/, /var/log/httpd/

Binary login records

FileRead with
wtmp (successful logins)last
btmp (failed logins)lastb
lastloglastlog

When /var/log fills up

StepCommand
Find the biggest filesdu -ah /var/log | sort -h | tail
Journal sizejournalctl --disk-usage
Deleted but still openlsof +L1 /var/log
Free space from an open fileTruncate it (: > file), don't rm it
Fix the causelogrotate 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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:

FileRHEL familyDebian/Ubuntu
General systemmessagessyslog
Authenticationsecureauth.log
Kernel(journal) / messageskern.log
Package managerdnf.logapt/history.log, dpkg.log
Bootboot.log(journal)
Auditaudit/audit.logaudit/audit.log
Login historywtmp, 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
var loglinux log fileslog directorypersistent logs
Embedded reference data

Quick lookup tables

/var/log operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for /var/log.

Lookup boundaryTopic-specific referenceOperational 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 verificationPin 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 chainproducer/configured path → filesystem/mount namespace → directory permissions → file inode → open descriptor/write → rotation/rename/create → reader/query → workload correlationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryA 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 evidenceCorrelated 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 correlationUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 pathLogging → /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 chainproducer/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 boundaryA 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?