haruatari / yii2-discord-log-target
1.0.1
2021-09-08 07:45 UTC
Requires
- php: >=7.0
- yiisoft/yii2: ~2.0
- yiisoft/yii2-httpclient: *
This package is auto-updated.
Last update: 2024-09-16 21:02:47 UTC
README
它通过webhook将日志消息发送到您的discord频道。
安装
通过Composer安装
composer require haruatari/yii2-discord-log-target
或者添加
"haruatari/yii2-discord-log-target" : "~1.0"
到您的composer.json
文件的require
部分。
使用方法
将其添加到您的Yii2配置文件中
// ... 'components' => [ 'log' => [ 'targets' => [ [ '__class' => \haruatari\yii2\discordLogTarget\DiscordTarget::class, 'webhookUrl' => "your webhook's url", 'messageTitle' => 'App name', // Application ID will be used if not specified 'avatarUrl' => 'https://your-avatar-image-url', // The image will be used as discord webhook avatar if specified ], ], ], ] // ...
您还可以使用标准的target参数,如categories
、levels
等。