Ffile2fix
Sign in Get started

What is a .log file?

A .log file is a plain-text record of events written by an application, web server or operating system, one entry per line. Developers read error.log, access.log, debug.log and laravel.log to find out why a site or script failed.

Key facts

  • Plain text, usually one timestamped entry per line; the format depends on the program (Apache combined log, PHP error log, JSON lines and so on).
  • Usually served as text/plain; files can grow from a few KB to many GB if not rotated.
  • Tools like logrotate rename and compress old logs as error.log.1, error.log.2.gz and so on.
  • Common Linux locations are /var/log/apache2/, /var/log/nginx/ and /var/log/php*-fpm.log; WordPress writes wp-content/debug.log when WP_DEBUG_LOG is on.
  • Logs often contain IP addresses, emails, tokens and file paths, so treat them as sensitive.

How to open a .log file

Windows

Small logs open in Notepad or VS Code. For large or live logs, run Get-Content .\app.log -Tail 100 -Wait in PowerShell.

macOS

Open it with the built-in Console app or a code editor, or run tail -f app.log in Terminal to follow new lines.

Linux

Run tail -n 100 -f /var/log/nginx/error.log to follow it, less +G app.log to browse from the end, and zless or zgrep for rotated .gz logs.

Common problems and fixes

Log file is too large to open
Editors load the whole file into memory. Read it with less, tail or grep instead, and set up logrotate or the framework's daily log setting to keep it small.
Log is empty or not being written
The process lacks write permission, logging is disabled, or it writes somewhere else. Check the configured path (such as error_log in php.ini or WP_DEBUG_LOG) and the file's owner and permissions.
"Permission denied" when reading /var/log
System logs are readable only by root or the adm group. Use sudo, or add your user to the adm group on Debian and Ubuntu.
Old entries are missing
They were rotated into .1 or .gz files or deleted by a retention policy. Look for app.log.1 and app.log.*.gz in the same folder and read them with zless.
Disk is full because of logs
Do not delete a log a process still has open, because the space is not released until it closes. Truncate it with : > app.log or sudo truncate -s 0 app.log, then fix the rotation.

Often converted to or from: CSV, JSON, TXT

Frequently asked questions

Is it safe to delete .log files?

Usually yes, since they only record past events, but you lose the history for debugging. Truncate active logs rather than deleting them, and keep logs your organisation needs for audits.

How do I find errors in a big log file?

Use grep -i 'error\|fatal' app.log | tail -50 on Linux and macOS, or Select-String -Path app.log -Pattern 'error' in PowerShell. Searching by timestamp around the failure narrows it quickly.

Where is the WordPress debug log?

With WP_DEBUG and WP_DEBUG_LOG set to true in wp-config.php, WordPress writes to wp-content/debug.log by default. Turn it off or block access to it afterwards, because it is publicly reachable on many servers.

See all file types β†’ Β· Browse error fixes β†’