/var/log Directory Overview

Linux System Logging Structure

The /var/log directory contains log files created by various system utilities and applications. These files are critical for system monitoring, debugging, and security auditing.

System Logs

System Services

Logs related to system services and daemons:

  • syslog - General system activity logs
  • messages - General system messages
  • daemon.log - System daemon logs
  • boot.log - System boot messages
Authentication Logs

User Authentication

Logs related to user authentication and authorization:

  • auth.log - Authentication logs
  • secure - Security-related messages
  • faillog - Failed login attempts
  • lastlog - Last login records
Application Logs

Applications & Services

Logs from specific applications and services:

  • mysql/ - MySQL database logs
  • apache2/ - Apache web server logs
  • nginx/ - Nginx web server logs
  • postgresql/ - PostgreSQL database logs
Security Logs

Security & Firewall

Logs related to system security:

  • ufw.log - Uncomplicated Firewall logs
  • firewalld - Firewall daemon logs
  • audit/ - Audit daemon logs
  • samba/ - Samba file sharing logs
Kernel Logs

Kernel & Hardware

Logs related to the Linux kernel and hardware:

  • kern.log - Kernel messages
  • dmesg - Device driver messages
  • hp/ - HP hardware diagnostics
Other Logs

Additional Log Files

Other important log files:

  • cron - Scheduled task logs
  • mail.log - Mail server logs
  • dpkg.log - Package management logs
  • alternatives.log - Alternatives system logs

Log Management Tips

Regularly monitor and rotate log files to prevent them from consuming too much disk space. Use tools like logrotate for automatic log rotation and journalctl for accessing systemd journal logs.

← Back to ServerMgmt Index ↑ Back to EXPANDED