Skip to content

Instantly share code, notes, and snippets.

@manojhl
Created November 23, 2018 07:10
Show Gist options
  • Save manojhl/9cf548bf19798a6e8338cae9d583f44a to your computer and use it in GitHub Desktop.
Save manojhl/9cf548bf19798a6e8338cae9d583f44a to your computer and use it in GitHub Desktop.
Debugging config for production - Error reporting
<?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