Read the error log
wp_get_error_logRead the last lines of WordPress's debug.log to diagnose PHP errors, warnings and notices. Returns the requested line count and log text, or an availability notice when no readable log exists.
Instructions
Return the last lines of wp-content/debug.log, where WordPress writes PHP errors, warnings and notices when WP_DEBUG_LOG is on, for diagnosing failures. Read-only; returns available, lines (the count returned) and log (the lines as one text). Without a readable file there it answers available=false with a message, not an error; a log written to another path is not read. The log can hold file paths, queries and data plugins wrote into it. Requires manage_options and runs only with write access on.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | How many trailing lines to return, 1 to 500 (values outside are clamped). Default 100. |