Debugging and Error Logging in WordPress

, , ,

So most servers do error logging but if you want to improve this functionality you can modify your wp-config.php file with the following code snippet.  It consolidates not only the PHP errors but also logs any WordPress bugs that get reported via WordPress debugging being turned on.

// Enable debugging
define('WP_DEBUG', true);

// Log all errors to a text file located at /wp-content/debug.log
define('WP_DEBUG_LOG', true);

// Don’t display error messages write them to the log file /wp-content/debug.log
define('WP_DEBUG_DISPLAY', false);

// Ensure all PHP errors are written to the log file and not displayed on screen
@ini_set('display_errors', 0);

 

Skills

Posted on

September 16, 2016

Submit a Comment

Your email address will not be published. Required fields are marked *