Created
November 23, 2018 07:10
-
-
Save manojhl/9cf548bf19798a6e8338cae9d583f44a to your computer and use it in GitHub Desktop.
Debugging config for production - Error reporting
This file contains 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
<?php | |
/** | |
* Debugging in production | |
* | |
* - Set error reporting to true | |
* - But don't display the errors | |
* - Instead log the errors in a file | |
*/ | |
// For PHP | |
// error_reporting(E_ALL); | |
@ini_set( 'log_errors', 'On' ); | |
@ini_set( 'display_errors', 'Off' ); | |
@ini_set( 'error_log', 'DIR_NAME/php_error.log' ); | |
/** | |
* For WordPress | |
*/ | |
define( 'WP_DEBUG', true ); // Enable WP_DEBUG mode | |
define( 'WP_DEBUG_DISPLAY', false ); // Disable display of errors and warnings | |
define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file | |
// define( 'SCRIPT_DEBUG', true ); // Use dev versions of core JS and CSS files | |
// define( 'SAVEQUERIES', true ); // Enable saving all database queries to an array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment