Skip to main content
DNS Checker(beta)

Server Log File Locations

Server Log File Locations: find every log file path on Ubuntu, Debian, RHEL, CentOS, cPanel, and Plesk.

Find the exact path to any log file on your Linux server or hosting panel. Select your operating system below for a complete reference of log file paths, configuration files, and commands for every service.

Ubuntu

Debian

RHEL Family

Hosting Panels

Debian vs RHEL: Key Differences

FeatureDebian/UbuntuRHEL/AlmaLinux/Rocky
Package Manageraptdnf
Firewallufwfirewalld
System Log/var/log/syslog/var/log/messages
Auth Log/var/log/auth.log/var/log/secure
Package Log/var/log/dpkg.log/var/log/dnf.log
Apache Packageapache2httpd
Apache Logs/var/log/apache2//var/log/httpd/
PHP-FPM Config/etc/php/{ver}/fpm//etc/php-fpm.d/
SELinux AuditN/A/var/log/audit/audit.log

Understanding Linux Log Systems

Modern Linux systems use a dual logging architecture with both traditional text logs and systemd's binary journal:

rsyslog (Traditional)

Writes human-readable text files to /var/log/. You can read these with cat, grep, tail, and other standard tools. Most services still write to these files for compatibility.

journald (systemd)

Stores structured binary logs with rich metadata (timestamps, PIDs, service names). Access via journalctl. Supports powerful filtering like journalctl -u nginx.service --since today.

In most distributions, rsyslog reads from journald and writes to text files, so you get both structured querying and classic grep-friendly logs.

Common journalctl Commands

  • journalctl -xe — recent errors
  • journalctl -u nginx.service — logs for a specific service
  • journalctl -f — follow logs in real time
  • journalctl --since "1 hour ago" — time-based filtering

Log Rotation with logrotate

The logrotate utility prevents log files from growing indefinitely by rotating, compressing, and deleting old logs automatically.

Main Configuration

/etc/logrotate.conf — global defaults (rotate weekly, keep 4 weeks, compress rotated logs)

Service Configs

/etc/logrotate.d/ — per-service rotation rules (e.g., nginx, apache2, mysql)

Rotated logs get numbered extensions (.1, .2, .3) or date stamps, and older logs are compressed with gzip (.gz). If a log is missing, check for /var/log/service/log.1.gz in the same directory.

Common Log Viewing Commands

Essential Commands

tail -f /var/log/nginx/error.log

Follow a log file in real time (Ctrl+C to stop)

grep "error" /var/log/syslog

Search for a pattern in a log file

journalctl -u nginx.service -f

Follow systemd logs for a specific service

less /var/log/mysql/error.log

View large log files with pagination and search

zcat /var/log/nginx/access.log.1.gz

Read compressed rotated logs without decompressing

Related Tools

Frequently Asked Questions