famdirksen/laravel-exception-monitor
Composer 安装命令:
composer require famdirksen/laravel-exception-monitor
包简介
Little Laravel package to notify you about exceptions in your application.
README 文档
README
This package notifies you when exceptions are thrown on some of your production application. It's like lite and free version of Bugsnag for small projects for which the use of this amazing SaaS tool would be simply overkill.
Installation
composer require famdirksen/laravel-exception-monitor
Next, you need to register Service Provider in config/app.php
$providers = [ ... Famdirksen\LaravelExceptionMonitor\ExceptionMonitorServiceProvider::class, ... ];
and then publish configuration files
php artisan vendor:publish --provider="Famdirksen\LaravelExceptionMonitor\ExceptionMonitorServiceProvider"
You also have to make sure if you have makzn/slack package installed and configured properly for Slack notifications.
Configuration
Config File is pretty self-explanatory.
<?php return [ /* |-------------------------------------------------------------------------- | Enabled sender drivers |-------------------------------------------------------------------------- | | Send a notification about exception in your application to supported channels. | | Supported: "mail", "slack". You can use multiple drivers. | */ 'drivers' => [ 'mail', 'slack' ], /* |-------------------------------------------------------------------------- | Enabled application environments |-------------------------------------------------------------------------- | | Set environments that should generate notifications. | */ 'environments' => [ 'production' ], /* |-------------------------------------------------------------------------- | Mail Configuration |-------------------------------------------------------------------------- | | It uses your app default Mail driver. You shouldn't probably touch the view | property unless you know what you're doing. | */ 'mail' => [ 'from' => 'sender@example.com', 'to' => 'recipient@example.com', 'view' => 'mails/exception-monitor' ], /* * Uses maknz\slack package. */ 'slack' => [ 'channel' => '#bugtracker', 'username' => 'Exception Monitor', 'icon' => ':robot_face:', ], ];
Usage
To start catching exceptions you have 2 options out there.
First option: Extend from Exception Handler provided by package (app/Exceptions/Handler.php):
use Famdirksen\LaravelExceptionMonitor\MonitorExceptionHandler; ... class Handler extends MonitorExceptionHandler
Second option: Make your report method in app/Exceptions/Handler.php to look like this:
public function report(Exception $e) { foreach ($this->dontReport as $type) { if ($e instanceof $type) { return parent::report($e); } } if (app()->bound('exception-monitor')) { app('exception-monitor')->notifyException($e); } parent::report($e); }
Changelog
Please see CHANGELOG for more information.
Tests
composer test
Contributing
Please see CONTRIBUTING for more details.
License
This library is licensed under the MIT license. Please see License file for more information.
famdirksen/laravel-exception-monitor 适用场景与选型建议
famdirksen/laravel-exception-monitor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.26k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2017 年 05 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「exception monitor」 「famdirksen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 famdirksen/laravel-exception-monitor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 famdirksen/laravel-exception-monitor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 famdirksen/laravel-exception-monitor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony bundle to monitor and execute commands
Collections of statsd collectors with templated metric names
A Laravel package to monitor queue jobs.
Error and Exception override and observers.
Error handler based on Booboo with HTML and JSON support
Standard PHP Library Extension featuring an ExceptionInterface.
统计信息
- 总下载量: 2.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-22