composer require dyanakiev/laravel-logger-discord-channel
Add the new discord channel type in your config/logging.php
configuration file, find the channels section and add the discord array within
'channels' => [
'discord' => [
'driver' => 'custom',
'via' => dyanakiev\LoggerDiscordChannel\DiscordLogger::class,
'webhook' => env('DISCORD_LOG_WEBHOOK', false), // E.g. https://discordapp.com/api/webhooks/...
'level' => env('DISCORD_LOG_LEVEL', 'debug'), // You can choose from emergency, alert, critical, error, warning, notice, info and debug
'environment' => env('DISCORD_LOG_ENVIRONMENT', 'production'), // Enable logging for environment production, staging' or local
'role_id' => env('DISCORD_LOG_TAG_ROLE_ID', false), // Tag a discord role
],
],
You may need to clear cache after installation if you get laravel.EMERGENCY: Unable to create configured logger. ... Log [discord] is not defined.
with
php artisan config:clear
Dont forget to cache the config again after clearing cache if ran on production :)
php artisan config:cache
@todo add picture