Snippet: Log errors to a file

Add following snippet to “wp-config.php”

Snippet

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Result

This will log all errors notices and warnings to a file called debug.log in wp-content (if Apache does not have write permission, you may need to create the file first and set the appropriate permissions (666) )

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>