haruatari/yii2-discord-log-target

1.0.1 2021-09-08 07:45 UTC

This package is auto-updated.

Last update: 2024-09-16 21:02:47 UTC


README

It sends log messages to your discord channel via webhook.

Packagist Version Total Downloads

Installation

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.

Usage

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.