PHPackages                             stephan-strate/monolog-discord - 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. stephan-strate/monolog-discord

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

stephan-strate/monolog-discord
==============================

Monolog handler to support Discord webhooks as log target

v1.0.1(4y ago)010[2 PRs](https://github.com/stephan-strate/monolog-discord/pulls)MITPHPPHP ^7.4 || ^8.0

Since Nov 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stephan-strate/monolog-discord)[ Packagist](https://packagist.org/packages/stephan-strate/monolog-discord)[ Docs](https://github.com/stephan-strate/monolog-discord)[ GitHub Sponsors](https://github.com/stephan-strate)[ RSS](/packages/stephan-strate-monolog-discord/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/792fe465d94c68e7141982755b4f527e1d30f173f6e933bd53f6d4d7fbe0b032/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374657068616e2d7374726174652f6d6f6e6f6c6f672d646973636f7264)](https://camo.githubusercontent.com/792fe465d94c68e7141982755b4f527e1d30f173f6e933bd53f6d4d7fbe0b032/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374657068616e2d7374726174652f6d6f6e6f6c6f672d646973636f7264)[![GitHub license](https://camo.githubusercontent.com/2d48d47226d07d27464250e8437a3cc7373d39666f935d0a9fc9ccbb6adfccf6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7374657068616e2d7374726174652f6d6f6e6f6c6f672d646973636f7264)](https://github.com/stephan-strate/monolog-discord/blob/master/LICENSE)[![GitHub Workflow Status (branch)](https://camo.githubusercontent.com/86a7abcb612552b602cc78693807e819a7741e4d60ab45e5cb21c3d730ed2b89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7374657068616e2d7374726174652f6d6f6e6f6c6f672d646973636f72642f43492f6d61737465723f6c6162656c3d6369)](https://camo.githubusercontent.com/86a7abcb612552b602cc78693807e819a7741e4d60ab45e5cb21c3d730ed2b89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7374657068616e2d7374726174652f6d6f6e6f6c6f672d646973636f72642f43492f6d61737465723f6c6162656c3d6369)

Monolog Discord Handler
=======================

[](#monolog-discord-handler)

Simple monolog handler to send your logs to Discords webhooks. You may ask yourself "Why another Discord handler? There are already plenty out there..." and you are right. There are [lefuturiste/monolog-discord-handler](https://github.com/lefuturiste/monolog-discord-handler) and [den1008/monolog-discord-handler](https://github.com/den1008/monolog-discord-handler) to only name two of them. What they all have in common is, they require [guzzlehttp](https://github.com/guzzle/guzzle). Don't get me wrong. guzzlehttp is a great library, but kinda huge for sending one simple request to Discords webhooks. Unfortunately the existing Discord handlers dependencies are also not really up to date. With help of dependabot I will keep the handler up to date and release regular maintenance updates.

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

[](#installation)

Using composer:

```
$ composer require stephan-strate/monlog-discord

```

Usage
-----

[](#usage)

### Create handler

[](#create-handler)

The webhook url can be obtained by following this [tutorial](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) by discord.

```
$handler = new Strate\Monolog\DiscordHandler('https://discord.com/api/webhooks/{webhook.id}/{webhook.token}', Logger::WARNING)
```

### Add handler to Monolog

[](#add-handler-to-monolog)

```
$log = new Monolog\Logger();
$log->pushHandler(handler);
```

Help &amp; Donate
-----------------

[](#help--donate)

I am very curious about projects that use my libraries. Please drop me a short message about what you use the library for. You can find my contact information on my profile (LinkedIn, E-mail).

If this project saved you time and money or you just appreciate what I am doing, please consider sponsoring me 😊

Acknowledgment
--------------

[](#acknowledgment)

This library was mainly created to resolve conflicting dependencies, which occured with my plugin [stephan-strate/grav-plugin-logger-channels](https://github.com/stephan-strate/grav-plugin-logger-channels) in combination with some other plugins of the [Grav](https://getgrav.org/) ecosystem.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

1624d ago

Major Versions

v0.0.1-alpha → v1.0.02021-11-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/95c6bea4d86f01f74afc3462e6d72fdbc9348f34e345fc4b7ffb355c1d5b7837?d=identicon)[stephan-strate](/maintainers/stephan-strate)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![stephan-strate](https://avatars.githubusercontent.com/u/19595615?v=4)](https://github.com/stephan-strate "stephan-strate (11 commits)")

---

Tags

discordloggingmonologmonolog-handlerphplogloggingmonologdiscord

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stephan-strate-monolog-discord/health.svg)

```
[![Health](https://phpackages.com/badges/stephan-strate-monolog-discord/health.svg)](https://phpackages.com/packages/stephan-strate-monolog-discord)
```

###  Alternatives

[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k6](/packages/inpsyde-wonolog)[lefuturiste/monolog-discord-handler

A simple monolog handler for support Discord webhooks

34111.6k4](/packages/lefuturiste-monolog-discord-handler)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[inpsyde/logzio-monolog

Logz.io integration for Monolog

191.2M1](/packages/inpsyde-logzio-monolog)[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)[mero/telegram-handler

Monolog handler to send log by Telegram

36113.3k](/packages/mero-telegram-handler)

PHPackages © 2026

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