Skip to content

Instantly share code, notes, and snippets.

@rohmann
Last active December 20, 2015 23:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rohmann/6213519 to your computer and use it in GitHub Desktop.
Save rohmann/6213519 to your computer and use it in GitHub Desktop.
http://git.io/gJANNQ Enables debug logging for Wordpress.This snippet can be placed in wp-config.php to quickly setup debug logging. Adapted from: http://premium.wpmudev.org/forums/topic/the-right-way-to-debug-php-in-wordpress
define('WP_DEBUG', true);
/**
* When debug mode is enabled, you can enable logging to store errors in wp-content/debug.log
* This is useful for finding errors that might not get displayed on screen
*
* The next conditional section will make sure errors are not shown to users when logging is enabled
* This helps with quick troubleshooting on live sites
*/
define('WP_DEBUG_LOG', true);
if(defined('WP_DEBUG_LOG') && WP_DEBUG_LOG == true) {
@ini_set('display_errors',0); //Prevent PHP from displaying errors
define('WP_DEBUG_DISPLAY', false); //Prevent Wordpress errors from being displayed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment