desarrolla2/mail-exception-bundle

用于向电子邮件报告异常的 Symfony 扩展包

安装数: 31,223

依赖项: 0

建议者: 0

安全性: 0

星标: 4

关注者: 4

分支: 2

开放性问题: 0

类型:symfony-bundle

0.6.9 2017-05-25 09:19 UTC

This package is auto-updated.

Last update: 2024-09-15 20:10:44 UTC


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'
            

示例

当发生异常时,您将在邮箱收件箱中收到类似以下内容。

screenshot

联系

您可以通过 @desarrolla2 联系我。