unixoff / monolog-discord
This package for sending logs of discord to a webhook channel.
v0.1.3
2022-01-11 20:59 UTC
Requires
- php: ^8.0
- ext-curl: *
- monolog/monolog: ^2.3
Requires (Dev)
- phpunit/phpunit: ^8
- vlucas/phpdotenv: ^5.4
This package is auto-updated.
Last update: 2024-04-16 11:31:48 UTC
README
This package for sending logs of discord to a webhook channel
Installation
composer require nullabler/monolog-discord
Usage
<?php require 'vendor/autoload.php'; use nullabler\MonologDiscord\DiscordWebhookHandler; $webhook = 'Your Webhook URL'; $log = new Monolog\Logger('discord'); $log->pushHandler(new DiscordWebhookHandler($webhook)); $log->info('hello world!');
Symfony setting
monolog: handlers: main: ... discord_webhook_handler: type: service id: discord_webhook_handler services: discord_webhook_handler: class: MonologDiscord\DiscordWebhookHandler arguments: $webhookUrl: '%env(string:DISCORD_WEBHOOK)%'
License
See the LICENSE Apache License 2.0.