desarrolla2 / mail-exception-bundle
用于向电子邮件报告异常的 Symfony 扩展包
0.6.9
2017-05-25 09:19 UTC
Requires
- symfony/framework-bundle: ~3.0
README
当 Symfony2 发生异常时,通过电子邮件发送一些信息。
安装
下载扩展包。
composer require "desarrolla2/mail-exception-bundle"
启用扩展包
// app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Desarrolla2\Bundle\MailExceptionBundle\MailExceptionBundle(), ); // ... } // ... }
使用方法
您需要在 config.yml 中添加类似以下内容
mail_exception: from: 'your@email.com' to: 'your@email.com' subject: 'An error has ocurred' avoid: environments: #this environments will be ignored - 'dev' - 'test' exceptions: #this exceptions will be ignored - 'Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException' - 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
示例
当发生异常时,您将在邮箱收件箱中收到类似以下内容。
联系
您可以通过 @desarrolla2 联系我。