Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guanguans/laravel-exception-notify

Monitor exception and report it to notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、Zulip).
https://github.com/guanguans/laravel-exception-notify

bark chanify discord error exception laravel monitor notification notifier notify pushdeer qq-bot slack telegram

Last synced: 2 days ago
JSON representation

Monitor exception and report it to notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、Zulip).

Awesome Lists containing this project

README

        

# laravel-exception-notify

> Monitor exception and report it to notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、Zulip).

[![tests](https://github.com/guanguans/laravel-exception-notify/workflows/tests/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions)
[![check & fix styling](https://github.com/guanguans/laravel-exception-notify/workflows/check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions)
[![codecov](https://codecov.io/gh/guanguans/laravel-exception-notify/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-exception-notify)
[![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-exception-notify/v)](https://packagist.org/packages/guanguans/laravel-exception-notify)
[![GitHub release (with filter)](https://img.shields.io/github/v/release/guanguans/laravel-exception-notify)](https://github.com/guanguans/laravel-exception-notify/releases)
[![Total Downloads](https://poser.pugx.org/guanguans/laravel-exception-notify/downloads)](https://packagist.org/packages/guanguans/laravel-exception-notify)
[![License](https://poser.pugx.org/guanguans/laravel-exception-notify/license)](https://packagist.org/packages/guanguans/laravel-exception-notify)

## Features

* Monitor exception and report it to notification channels
* Support for extending customized channels
* Support for notification rate limiting
* Support for customized data pipe
* Support for customized data collector

## Related Links

* [https://github.com/guanguans/notify](https://github.com/guanguans/notify)
* [https://github.com/guanguans/yii-log-target](https://github.com/guanguans/yii-log-target)

## Requirement

* PHP >= 7.4

## Installation

```bash
composer require guanguans/laravel-exception-notify --ansi -v
```

## Configuration

### Publish files(optional)

```bash
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider" --ansi -v
```

### Apply for channel authentication and other information

* [Notify](https://github.com/guanguans/notify#platform-support)
* Dump(For debugging exception messages)
* Log
* Mail

### Configure channels in the `config/exception-notify.php` and `.env` file

```dotenv
# EXCEPTION_NOTIFY_DEFAULTS=dingTalk,lark,mail,slack,telegram,...
EXCEPTION_NOTIFY_DEFAULTS=log,slack,weWork
EXCEPTION_NOTIFY_SLACK_WEBHOOK=https://hooks.slack.com/services/TPU9A9/B038KNUC0GY/6pKH3vfa3mjlUPcgLSjzR
EXCEPTION_NOTIFY_WEWORK_TOKEN=73a3d5a3-ceff-4da8-bcf3-ff5891778
```

## Usage

### Test for exception notify

```shell
php artisan exception-notify:test --ansi -v
```

### Notification examples

| discord | lark | mail |
|:----------------------------:|:----------------------:|:----------------------:|
| ![discord](docs/discord.jpg) | ![lark](docs/lark.jpg) | ![mail](docs/mail.jpg) |

### Skip report

Modify the `boot` method in the `app/Providers/AppServiceProvider.php` file

```php
Arr::first(
[
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Http\Exceptions\HttpResponseException::class,
],
static fn (string $exception): bool => $throwable instanceof $exception
));
}
```

### Custom channel

Modify the `boot` method in the `app/Providers/AppServiceProvider.php` file

```php