kabbouchi/laravel-logger-discord-channel

基于Discord的Laravel Monolog驱动

v0.4.0 2020-09-09 06:59 UTC

This package is auto-updated.

Last update: 2024-09-09 15:26:24 UTC


README

基于Discord的Laravel Monolog驱动

安装

composer require kabbouchi/laravel-logger-discord-channel

使用

在您的config/logging.php配置文件中添加新的驱动类型

'channels' => [
    'discord' => [
        'driver' => 'custom',
        'via' => KABBOUCHI\LoggerDiscordChannel\DiscordLogger::class,
        'webhook' => 'https://discordapp.com/api/webhooks/.....',
        'level' => 'DEBUG',
        'role_id' => null, // role to tag in the error,
        'environment' => 'production', // or ['production', 'staging', 'local']
    ],
],

注意

如果安装后遇到错误laravel.EMERGENCY: 无法创建配置的记录器。 ... 日志[discord]未定义。,您可能需要清除缓存

php artisan config:clear