WordPress
debug.log
debug.log is the text file WordPress writes PHP notices, warnings, and fatal errors to when logging is turned on. By default it sits in wp-content/ and is the first place to look when a white screen gives you nothing.
How it is measured
Logging is enabled with define( 'WP_DEBUG', true ) and define( 'WP_DEBUG_LOG', true ) in wp-config.php. WP_DEBUG_LOG can also be a path string. Each line carries a timestamp in UTC and a message such as [01-Oct-2026 07:44:10 UTC] PHP Warning: Undefined array key in /wp-content/plugins/foo/bar.php on line 88.
Measure it by file size and by unique messages: ls -lh wp-content/debug.log, then sort and count lines with uniq -c to find the one warning repeating 40,000 times.
Worked example
A client site slows to 5 seconds per page after a plugin update. The developer turns on logging for an hour and finds debug.log at 410 MB, with a single deprecation notice repeated on every get_posts call from an old gallery plugin. Disk writes are most of the slowdown.
He turns logging off, deletes the file, and the site returns to 900 ms. A week later a crawler requests /wp-content/debug.log directly and receives the full text, including absolute server paths.
How it differs
debug.log is the file; WP_DEBUG is the switch that decides which errors WordPress reports at all. WP_DEBUG_LOG decides whether they are written to the file, and WP_DEBUG_DISPLAY decides whether they print on the page. Turning on the file does not hide errors from visitors unless you also turn display off.
Common errors
Leaving logging on in production for months. Not blocking direct web access to the file. Setting WP_DEBUG_DISPLAY true on a live site. Reading only the last line and missing the first fatal error that started the cascade. Attaching the raw log to a public support thread with paths and API keys in stack traces.
In practice
Turn on logging for a defined window, reproduce the problem, read it, then turn it off and delete the file. Add a deny rule for debug.log in .htaccess or the server config. Point WP_DEBUG_LOG at a path outside the web root if the host allows.