PHPackages                             gentenox/sentry-monolog-handler - 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. gentenox/sentry-monolog-handler

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

gentenox/sentry-monolog-handler
===============================

Custom Sentry handler for Monolog for sending log context data to sentry eventsand it's focussed on ease-of-use and elegant syntax.

v2.0.1(3y ago)217.6k↓25%1MITPHPPHP &gt;=8.1

Since Sep 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Gentenox/sentry-monolog-handler)[ Packagist](https://packagist.org/packages/gentenox/sentry-monolog-handler)[ RSS](/packages/gentenox-sentry-monolog-handler/feed)WikiDiscussions main Synced 1mo ago

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

sentry-monolog-handler
======================

[](#sentry-monolog-handler)

Custom Sentry handler for Monolog for sending log context data to sentry events with additional event information and it's focussed on ease-of-use and elegant syntax

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

[](#installation)

### Install via composer

[](#install-via-composer)

You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:

```
composer require gentenox/sentry-monolog-handler
```

### Add config for monolog handler to config/packages/monolog.yaml

[](#add-config-for-monolog-handler-to-configpackagesmonologyaml)

```
monolog:
  handlers:
    sentry:
      type: service
      id: monolog_context_handler
```

### Add new service to services.yaml

[](#add-new-service-to-servicesyaml)

```
monolog_context_handler:
  class: SentryMonologHandler\MonologContextHandler
  arguments:
    $hub: '@Sentry\State\HubInterface'
    $level: !php/const Monolog\Logger::ERROR
```

Basic Usage
-----------

[](#basic-usage)

In examples below used monolog logger that implements **Psr\\Log\\LoggerInterface**

### Log error with context data

[](#log-error-with-context-data)

In this example sentry error handler receive logger context data end send it to Sentry as sentry **event context data**

```
$logger->error('Cannot find existing order for user', [
    'user_id' => $user->getId()
]);
```

### Log with specific sentry properties

[](#log-with-specific-sentry-properties)

In this example sentry error handler receive logger context data and handle specific properties such as **tags** and **fingerprint**These specific properties will not be added to logs and used only for providing additional event information to Sentry

FieldTypeDescription`MonologFields::Tags`arrayContains Sentry tags. Tags are key/value string pairs and used for filtering events`MonologFields::Fingerprint`arrayContains Sentry fingerprint. Events with the same fingerprint are grouped together into an issue```
$logger->error('Invalid postback received', [
    MonologFields::Tags->value => ['scope' => 'postback_validation']
    MonologFields::Fingerprint->value => ['postback_validation_fingerprint']
]);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~73 days

Total

5

Last Release

1412d ago

Major Versions

v1.0.4 → v2.0.02022-06-17

PHP version history (2 changes)1.0.0PHP &gt;=7.1

v2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1097bd6260904385935e39470a4c46651071086870a5547c084ee3eaed1f464c?d=identicon)[cheshir](/maintainers/cheshir)

---

Top Contributors

[![o-kad-dev](https://avatars.githubusercontent.com/u/107208414?v=4)](https://github.com/o-kad-dev "o-kad-dev (3 commits)")[![cheshir](https://avatars.githubusercontent.com/u/1440703?v=4)](https://github.com/cheshir "cheshir (2 commits)")[![vadim-sychov](https://avatars.githubusercontent.com/u/60182023?v=4)](https://github.com/vadim-sychov "vadim-sychov (1 commits)")

---

Tags

symfonysentry

### Embed Badge

![Health badge](/badges/gentenox-sentry-monolog-handler/health.svg)

```
[![Health](https://phpackages.com/badges/gentenox-sentry-monolog-handler/health.svg)](https://phpackages.com/packages/gentenox-sentry-monolog-handler)
```

###  Alternatives

[sentry/sentry-symfony

Symfony integration for Sentry (http://getsentry.com)

73661.4M66](/packages/sentry-sentry-symfony)[macpaw/sentry-monolog-adapter

Sentry monolog logging bundle

25232.9k](/packages/macpaw-sentry-monolog-adapter)[oneup/contao-sentry-bundle

This bundle provides an easy integration of sentry.io for Contao 4.4.x and newer.

1114.8k](/packages/oneup-contao-sentry-bundle)

PHPackages © 2026

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