It sends log messages to your discord channel via webhook.
Install via Composer:
composer require haruatari/yii2-discord-log-target
or add
"haruatari/yii2-discord-log-target" : "~1.0"
to the require
section of your composer.json
file.
Ad it into your Yii2 config file:
// ...
'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
],
],
],
]
// ...
You also can use standard target parameters like categories
, levels
etc.