In general, error logging should be enabled in the development environment and disabled in production environments.
To enable WordPress error reporting to the browser, and to enable error logging to file, add the following lines to wp-config.php:
<?php // Enable error reporting output to browser. Default value is false. define( 'WP_DEBUG', true ); // log errors to `/wp-content/debug.log`. Useful when debugging code that does not output to browser. define('WP_DEBUG_LOG', true);