The issue I have right now is that it is hard to find actual bugs because so many E_NOTICEs are found. We have nearly 600 sites on our server with complicated scripts, and I've done a lot to handle a great deal of them, but there are still quite a few.
I receive an email and a text every time the error percentage is too high, which is great to prevent problems.
I'm sure I'm not the only one to encounter this problem -- is there a recommended solution? I've tried setting error_reporting( E_ALL ^ E_NOTICE );
but it hasn't stopped it.
One possible solution I've thought of is not setting New Relic as the error handler, using my own, and then sending them the error if it's not an E_NOTICE. Haven't figured out how to do this just yet.
New Relics's PHP agent will not trace E_NOTICE errors unless you've explicitly used set_error_handler(newrelic_notice_error);
If you'd like New Relic to trace some but not all uncaught exceptions, creating your own error handler which calls newrelic_notice_error would make sense.
There is more information regarding this in the New Relic documentation: https://newrelic.com/docs/php/the-php-api
In most cases, it is not necessary, or advised, to set New Relic as the error handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With