thtmorais / yii2-log-discord-target
Discord log target for Yii2
Installs: 4 970
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- ext-curl: *
- ext-json: *
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2024-11-21 06:51:31 UTC
README
This is the PHP Yii2 plugin for sending log of a yii application through the Discord WebHook API.
Important
You should avoid to use this target on a frequent events because of restriction in 30 messages per 60 seconds for the web-hooks.
Installation
Execute following command in shell:
composer require thtmorais/yii2-log-discord-target
Or add following in your composer.json
require section, and run composer install
in your shell
"thtmorais/yii2-log-discord-target": "*"
Configuration and usage
Add something as following in your yii config into the components
section
'log' => [
'class' => '\thtmorais\log\DiscordTarget',
'url' => 'WEBHOOK_URL', // Your WebHook URL
//'pattern' => "{category}: {level}\n{text}", // Optionally you can override default message pattern
]
More info about log targets may be found here