Click on the channel settings icon and select integrations
.
LOG_DISCORD_WEBHOOK_URL=<insert-the-webhook-url-here>
use Monolog\Handler\SlackWebhookHandler;
// ...
// place this inside the channels array
'discord' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'error'),
'handler' => SlackWebhookHandler::class,
'handler_with' => [
'webhookUrl' => env('LOG_DISCORD_WEBHOOK_URL') . '/slack',
'username' => env('APP_NAME') . ' (' . env('APP_ENV') . ')',
'includeContextAndExtra' => true,
'useAttachment' => true,
'useShortAttachment' => true,
],
],
'stack' => [
'driver' => 'stack',
'channels' => 'daily,discord',
'ignore_exceptions' => false,
],
The error logging config appends a /slack
to the URL to make the logging compatible.
Don't forget to append /slack
to your discord webhook URLs ff you need a slack compatible webhook for something else than logging.
https://discord.com/api/webhooks/<whatever>/<whatever>
https://discord.com/api/webhooks/<whatever>/<whatever>/slack