Symfony2 Monolog只发送一些例外情况

时间:2022-10-16 14:48:50

I am using Monolog in a Symfony2 project and I'm getting tired of seeing exception emails that occur because of Access Denied and a few other cases that are not interesting to me (there are automated requests that cause this).

我在Symfony2项目中使用Monolog,我已经厌倦了看到由于拒绝访问而发生的异常电子邮件以及一些我不感兴趣的其他情况(有自动请求导致这种情况)。

Is there a way to specify a callback for Monolog that returns true/false depending on whether I want to email it?

有没有办法为Monolog指定一个返回true / false的回调,具体取决于我是否要通过电子邮件发送它?

1 个解决方案

#1


1  

As far as i know, you have to override ExceptionListener and take the control over your hands. After this override process, you can send what you want to be emailed.

据我所知,你必须覆盖ExceptionListener并控制你的手。在此覆盖过程之后,您可以发送要通过电子邮件发送的内容。

#1


1  

As far as i know, you have to override ExceptionListener and take the control over your hands. After this override process, you can send what you want to be emailed.

据我所知,你必须覆盖ExceptionListener并控制你的手。在此覆盖过程之后,您可以发送要通过电子邮件发送的内容。