How do you change error reporting to only show errors in WordPress?

I'm working on a development site that has some plugins that produce notices. It's a bit annoying during development when you only want to see the errors your own code produces.

How can you turn off notices in WordPress but keep reporting of errors enabled?

I thought this should work, but it doesn't:

define( 'WP_DEBUG', true );
error_reporting(E_ALL  ~E_NOTICE);

Edit: I should point out that I added this code to the wp-config.php, just to be clear.

Topic wp-debug debug errors Wordpress

Category Web


Alternatively you can create a debug logging file for where you can read the errors. Source: http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log

/**
 * 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 (i.e. use 666) ) 
 */

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

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.