wp-config.php file configurations:

define( ‘WP_DEBUG’, true);
// To turn on or off debug mode

/* Debug mode configuration */
if ( WP_DEBUG ) {

define( ‘SCRIPT_DEBUG’, true);
// Turn on JavaScript and CSS error notifications

define( ‘WP_DEBUG_LOG’, true);
// Write error norification to log file ( default file is located – /wp-content/debug.log )

define( ‘WP_DEBUG_DISPLAY’, off);
// Not allow to show error notification on display
}

Not to make log file accessible, you should add these lines on .htaccess file in log file directory.

<Files “debug.log”>
Order Allow,Deny
Deny from all </Files>