定制 olegstepura/error-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

olegstepura/error-bundle

Composer 安装命令:

composer require olegstepura/error-bundle

包简介

Email notify about errors and exceptions happened in production mode

README 文档

README

Render an error if IP is in allowed list or send an email on each error raised or exception thrown in production mode of a deployed symfony application (you should know that something went wrong).

Usage

Install the bundle as usual. Enable the bundle in AppKernel for all modes:

app/AppKernel.php

<?php
        $bundles = array(
            // ...
            new Ost\ErrorBundle\OstErrorBundle($this),
            // ...
        );

Be sure to check that mail sending works with your current configuration. Now edit configuration files:

app/config/config.yml

ost_error:
  display:
    ips: ['10.10.10.2', '10.10.10.3']

Here we entered the IP's from which you are allowed to see the warning notifications on the site in production mode (in debug it's converted to exceptions by Symfony).

app/config/config_dev.yml

ost_error:
  mailer: false
  display: true

Disabled the mailer in dev mode since you are actually not going to recieve mails on errors while in dev mode.

app/config/config_prod.yml

ost_error:
  mailer:
    to: your.email@provider.com
    from: server.email@server.com
    report_not_found: false

Just enter your mail here. And tick the option if you want to recieve notifications on NotFoundHttpException.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-04-17