当前位置: 首页 > 后端技术 > PHP

laravel-exception-notify-支持多通道的laravel异常监控通知

时间:2023-03-30 03:04:56 PHP

laravel-exception-notify-laravel异常监控通知,支持多渠道(钉钉群机器人、飞书群机器人、服酱、企业微信群机器人、资讯)。功能监控发送Laravel应用异常支持多渠道(钉钉群机器人、飞书群机器人、服酱、企业微信群机器人、资讯)自定义发送异常信息数据源码https://github.com/guanguans/laravel-exception-notify相关项目https://github.com/guanguans/notifyhttps://github.com/guanguans/yii-log-目标环境要求laravel>=5.5安装$composerrequireguanguans/laravel-exception-notify-vvv配置发布service$phpartisanvendor:publish--provider="Guangans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"申请通道token等信息钉钉群机器人飞书群机器人ServerSauce企业微信群机器人信息配置文件配置token等信息config/exception-notify.php使用修改后的app/Exceptions/Handler.php文件中的report方法publicfunctionreport(Exception$exception){//添加d代码$this->shouldReport($exception)and\ExceptionNotifier::report($exception);////或//$this->shouldReport($exception)和app('exception.notifier')->report($exception);////或//$this->shouldReport($exception)和\Guangans\LaravelExceptionNotify\Facades\Notifier::report($exception);parent::report($exception);}通知结果