新的遗物错误报告 - 停止捕捉E_NOTICE错误 [英] New Relic Error Reporting - Stop Catching E_NOTICE errors

查看:177
本文介绍了新的遗物错误报告 - 停止捕捉E_NOTICE错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在的问题是,很难找到实际的错误,因为找到了很多E_NOTICE。我们在我们的服务器上有近600个站点,复杂的脚本,我已经做了很多处理它们,但仍然有很多。

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.

我相信我不是唯一一个遇到这个问题 - 有没有推荐的解决方案?我试过设置 error_reporting(E_ALL ^ E_NOTICE); ,但是还没有停止。

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.

我想到的解决方案是没有将New Relic设置为错误处理程序,使用我自己的,然后发送错误,如果它不是E_NOTICE。没有想到如何做到这一点。

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.

推荐答案

新的Relics的PHP代理将不会跟踪E_NOTICE错误,除非你明确使用 set_error_handler(newrelic_notice_error);

New Relics's PHP agent will not trace E_NOTICE errors unless you've explicitly used set_error_handler(newrelic_notice_error);

如果您想要New Relic跟踪一些但不是所有未捕获的异常创建您自己的错误处理程序,调用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.

新的Relic文档中有关于此的更多信息: https://newrelic.com/docs/php/the-php-api

There is more information regarding this in the New Relic documentation: https://newrelic.com/docs/php/the-php-api

在大多数情况下,没有必要或建议将New Relic设置为错误处理程序。

In most cases, it is not necessary, or advised, to set New Relic as the error handler.

这篇关于新的遗物错误报告 - 停止捕捉E_NOTICE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆