Linux Log Sources Map in Production
On this page
Why You Need a Log Source Map
During incidents, time is lost not in debugging — but in searching where logs are. A production engineer must know which subsystem logs where. Observability starts with log source awareness.
Symptom
- Service failure but no obvious error in expected log
- Authentication issues with no clear trace
- Kernel-level crash with only partial application logs
- Security incident with missing timeline
Root Cause
- No mental model of log layers
- Assuming application logs contain everything
- Ignoring kernel and systemd logs
- No audit visibility
Primary Log Sources
1) Authentication Logs
Debian/Ubuntu:
/var/log/auth.log
RHEL-based:
/var/log/secure
2) Systemd Journal
journalctl
Per service:
journalctl -u nginx
3) Kernel Logs
dmesg journalctl -k
4) Application Logs
Typically located under:
/var/log/ /var/www/app/logs/ /opt/app/logs/
5) Audit Logs
/var/log/audit/audit.log
6) Cron Logs
journalctl -u cron
Investigation Flow
- Start with service log
- Check systemd journal for service failures
- Check auth logs for access anomalies
- Check kernel logs for resource or driver errors
- Correlate timestamps across sources
Log Time Correlation
timedatectl
Ensure system clock is synchronized (NTP active). Incorrect time breaks forensic reconstruction.
Hardening Strategy
- Standardize log locations across fleet
- Centralize logs (ELK, SIEM, cloud logging)
- Define log retention policy
- Ensure logs are not world-writable
- Enable audit logging for sensitive changes
Why This Matters in Real Infrastructure
Incidents unfold across layers: application → systemd → kernel → network. Without a clear map of log sources, engineers waste critical response time. Observability begins with knowing where the truth is recorded.