haruatari/yii2-discord-log-target

安装: 279

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

1.0.1 2021-09-08 07:45 UTC

This package is auto-updated.

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


README

它通过webhook将日志消息发送到您的discord频道。

Packagist Version Total Downloads

安装

通过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参数,如categorieslevels等。