This package for sending logs of discord to a webhook channel
composer require dev-null-group/monolog-discord
<?php
require 'vendor/autoload.php';
use DevNullGroup\MonologDiscord\DiscordWebhookHandler;
$webhook = 'Your Webhook URL';
$log = new Monolog\Logger('discord');
$log->pushHandler(new DiscordWebhookHandler($webhook));
$log->info('hello world!');
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)%'
See the LICENSE Apache License 2.0.