PHPackages                             jgfontana/laravel-discord-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jgfontana/laravel-discord-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jgfontana/laravel-discord-logger
================================

Logging to a discord channel in Laravel

0121PHP

Since Sep 23Pushed 1y agoCompare

[ Source](https://github.com/jgfontana/laravel-discord-logger)[ Packagist](https://packagist.org/packages/jgfontana/laravel-discord-logger)[ RSS](/packages/jgfontana-laravel-discord-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Discord Logger
======================

[](#laravel-discord-logger)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a14cd7e837be473037f205835151c5e821e38f6ca270c33bdc3890b35c0cc87b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a67666f6e74616e612f6c61726176656c2d646973636f72642d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jgfontana/laravel-discord-logger)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/10fcc26dc5aba7918f7ea46d8d16928b4b401eac86b7e58f001d3b23f5ef5446/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a67666f6e74616e612f6c61726176656c2d646973636f72642d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jgfontana/laravel-discord-logger)

`jgfontana/laravel-discord-logger` is a laravel package providing a logging handler to send logs to a Discord channel.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jgfontana/laravel-discord-logger
```

If you are using Laravel 5.5 or later, the service provider will automatically be discovered.

On earlier versions, you need to do that manually. You must install the service provider:

```
// config/app.php
'providers' => [
    ...
    MarvinLabs\DiscordLogger\ServiceProvider::class
];
```

You can then publish the configuration file:

```
php artisan vendor:publish --provider "MarvinLabs\DiscordLogger\ServiceProvider"
```

Setup
-----

[](#setup)

### Prepare the discord channel web hook

[](#prepare-the-discord-channel-web-hook)

Create a discord web hook for the channel which will receive the logs.

### Prepare the logger configuration

[](#prepare-the-logger-configuration)

You must add a new channel to your `config/logging.php` file:

```
// config/logging.php
'channels' => [
    //...
    'discord' => [
        'driver' => 'custom',
        'via'    => MarvinLabs\DiscordLogger\Logger::class,
        'level'  => 'debug',
        'url'    => env('LOG_DISCORD_WEBHOOK_URL'),
        'ignore_exceptions' => env('LOG_DISCORD_IGNORE_EXCEPTIONS', false),
    ],
];
```

You can then provide the web-hook URL in your `.env` file:

```
LOG_DISCORD_WEBHOOK_URL=https://discordapp.com/api/webhooks/abcd/1234

```

### Use the logger channel

[](#use-the-logger-channel)

You have two options: log only to discord or add the channel to the stack

#### Log only to the discord channel

[](#log-only-to-the-discord-channel)

Simply change the `.env` variable to use the discord channel

```
LOG_CHANNEL=discord

```

#### Add the channel on top of other channels

[](#add-the-channel-on-top-of-other-channels)

Add the channel to the stack in the `config/logging.php` configuration:

```
// config/logging.php
'channels' => [
    //...
    'stack' => [
        'driver'   => 'stack',
        'channels' => ['single', 'discord'],
    ],
];
```

Then make sure the logging channel is set to stack in your `.env` file:

```
LOG_CHANNEL=stack

```

#### Logging to multiple Discord channels

[](#logging-to-multiple-discord-channels)

Of course, you can send your log messages to multiple Discord channels. Just create as many channels as desired in `config/logging.php` and put them in the stack. Each channel should be named differently and should point to a different web hook URL.

What does it look like?
-----------------------

[](#what-does-it-look-like)

You can get a preview of what it looks like using each of the provided converters.

[![Screenshot](/assets/screenshot.png)](/assets/screenshot.png)

The communication with Discord Web hook failed
----------------------------------------------

[](#the-communication-with-discord-web-hook-failed)

You might encounter this exception alongside "cURL error 60: SSL certificate problem: unable to get local issuer certificate" while using/testing your web hook in a development enviroment. This occurs due to your local machine's inability to verify the server's SSL certificate.

### To resolve this issue, follow these steps:

[](#to-resolve-this-issue-follow-these-steps)

- Obtain the cacert.pem file from the curl website.
- Store the cacert.pem file in a secure location on your computer, such as C:\\xampp\\php\\extras\\ssl\\cacert.pem.
- Access your php.ini file, typically found in your PHP installation directory.
- Locate curl.cainfo = in php.ini. If it's commented out (begins with a ;), remove the semicolon.
- Insert the path to cacert.pem you saved earlier. Example: curl.cainfo = "C:\\xampp\\php\\extras\\ssl\\cacert.pem".
- Save the php.ini file and restart your server to implement the changes.

Version history
---------------

[](#version-history)

See the [dedicated change log](CHANGELOG.md)

Credits
-------

[](#credits)

- Got some ideas from [GrKamil/laravel-telegram-logging](https://github.com/GrKamil/laravel-telegram-logging)
- Got some ideas from [lefuturiste/monolog-discord-handler](https://github.com/lefuturiste/monolog-discord-handler)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cc48cbba94bd732a0e834f1195d19905a687f1151593a85f7668c194d78fb5d?d=identicon)[jgfontana](/maintainers/jgfontana)

---

Top Contributors

[![vpratfr](https://avatars.githubusercontent.com/u/2526465?v=4)](https://github.com/vpratfr "vpratfr (32 commits)")[![jgfontana](https://avatars.githubusercontent.com/u/44171302?v=4)](https://github.com/jgfontana "jgfontana (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![EnanoFurtivo](https://avatars.githubusercontent.com/u/31115763?v=4)](https://github.com/EnanoFurtivo "EnanoFurtivo (1 commits)")[![filliph](https://avatars.githubusercontent.com/u/9424286?v=4)](https://github.com/filliph "filliph (1 commits)")[![Jespertastesen](https://avatars.githubusercontent.com/u/7554271?v=4)](https://github.com/Jespertastesen "Jespertastesen (1 commits)")[![kiritokatklian](https://avatars.githubusercontent.com/u/6556281?v=4)](https://github.com/kiritokatklian "kiritokatklian (1 commits)")[![Linc70J](https://avatars.githubusercontent.com/u/31087557?v=4)](https://github.com/Linc70J "Linc70J (1 commits)")[![miraries](https://avatars.githubusercontent.com/u/4648498?v=4)](https://github.com/miraries "miraries (1 commits)")[![pablorsk](https://avatars.githubusercontent.com/u/938894?v=4)](https://github.com/pablorsk "pablorsk (1 commits)")[![sgtcoder](https://avatars.githubusercontent.com/u/2577827?v=4)](https://github.com/sgtcoder "sgtcoder (1 commits)")[![Shaggy84675](https://avatars.githubusercontent.com/u/1374803?v=4)](https://github.com/Shaggy84675 "Shaggy84675 (1 commits)")[![sibkod](https://avatars.githubusercontent.com/u/90373295?v=4)](https://github.com/sibkod "sibkod (1 commits)")[![ThomasBS](https://avatars.githubusercontent.com/u/5128963?v=4)](https://github.com/ThomasBS "ThomasBS (1 commits)")[![viorelmd](https://avatars.githubusercontent.com/u/8680980?v=4)](https://github.com/viorelmd "viorelmd (1 commits)")[![8ctopus](https://avatars.githubusercontent.com/u/13252042?v=4)](https://github.com/8ctopus "8ctopus (1 commits)")[![Xinecraft](https://avatars.githubusercontent.com/u/3089863?v=4)](https://github.com/Xinecraft "Xinecraft (1 commits)")[![andjsch](https://avatars.githubusercontent.com/u/9936988?v=4)](https://github.com/andjsch "andjsch (1 commits)")[![BrandonDR](https://avatars.githubusercontent.com/u/30581808?v=4)](https://github.com/BrandonDR "BrandonDR (1 commits)")

### Embed Badge

![Health badge](/badges/jgfontana-laravel-discord-logger/health.svg)

```
[![Health](https://phpackages.com/badges/jgfontana-laravel-discord-logger/health.svg)](https://phpackages.com/packages/jgfontana-laravel-discord-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
