Last active
December 20, 2015 23:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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