[ad_1]
[ad_2]
I need logging to run but need to suppress warning logs. I tried a few tutorials online and none worked, such as https://wp-umbrella.com/troubleshooting/turning-off-php-errors-in-wordpress/ and adding the below in wp-config.php
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);

// Enable WP_DEBUG mode
define( ‘WP_DEBUG’, true );
// Enable error logging to /wp-content/debug.log
define( ‘WP_DEBUG_LOG’, true );
// Disable display of errors and warnings
define( ‘WP_DEBUG_DISPLAY’, false );
@ini_set( ‘display_errors’, 0 );
// Set error reporting to exclude warnings
@ini_set( ‘error_reporting’, E_ALL & ~E_WARNING );
error_reporting( E_ALL & ~E_WARNING );
If that’s not working, you are probably unable to override your php.ini configuration file. Check with your host and either have them update php.ini or have them provide documentation on how you can do so. Then you’ll need to adjust the *error_reporting* line there.
Try this:
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
@ini_set(‘display_errors’, 0);
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);