An error log is a file that records what went wrong when a page, script or server request failed.
An error log is a running record of problems on your website. Each time something fails, the server writes a line with the date, time, the file involved and a short description of what happened. When your site shows a blank page or a "500 Internal Server Error", the error log is usually where the real explanation is.
For example, a line like PHP Fatal error: Allowed memory size exhausted in /wp-content/plugins/slider/slider.php on line 212 tells you exactly which plugin ran out of memory and where.
Types of error logs
Most hosting accounts have more than one log:
- Web server error log: problems handling requests, such as missing files, permission errors and bad .htaccess rules.
- PHP error log: errors from your code, including fatal errors, warnings and notices. Often saved as a file called
error_login the folder where the script ran. - Application logs: some software keeps its own. WordPress writes to
debug.logwhen debugging is turned on. - Access log: not an error log, but useful alongside one because it shows every request, including which ones returned errors.
How to read an error log
Start at the bottom, where the newest entries are, and look for lines that match the time the problem happened. Each entry usually tells you:
- When it happened.
- How serious it was: fatal errors stop the page, warnings and notices usually don't.
- What went wrong, in a short message.
- Where, as a file path and line number.
The file path often points straight to the cause. A path inside a plugin or theme folder means that plugin or theme is the likely culprit.
Common errors you'll find in an error log
- Memory limit exhausted, often caused by a heavy plugin or a large import.
- Calls to undefined functions after a PHP version change.
- File permission errors after uploading files with the wrong settings.
- Database connection errors when MySQL details are wrong.
- Timeouts when a script runs too long.
Error log tips and mistakes to avoid
Don't leave detailed error display switched on for visitors. Showing errors on screen can reveal file paths and other details attackers find useful. Log them to a file instead. Also keep an eye on log size. A plugin that writes thousands of warnings a day can create huge files that use up disk space and inodes. Fix the cause rather than just deleting the log.
On AblePage you can open your logs from cPanel, and if you're stuck, support will read them with you.