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

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

bgalati/monolog-sentry-handler
==============================

Sentry handler for PHP SDK v2/v3

2.1.0(2y ago)60837.4k—8%74MITPHPPHP ^7.4 || ^8.0

Since Aug 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (10)Versions (9)Used By (4)

Monolog Sentry Handler
======================

[](#monolog-sentry-handler)

[![CI](https://github.com/B-Galati/monolog-sentry-handler/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/B-Galati/monolog-sentry-handler/actions/workflows/ci.yml?query=branch%3Amain)[![Latest Version](https://camo.githubusercontent.com/6458bb314abcc1a31de15bb3a047562b4204d391fef093c1ab4ccf231dd9f67d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f422d47616c6174692f6d6f6e6f6c6f672d73656e7472792d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bgalati/monolog-sentry-handler)[![MIT License](https://camo.githubusercontent.com/10ac90f9c1b6ba3e96f83fe6f1482a81886b295a42bb292d1929cd633790b033/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f422d47616c6174692f6d6f6e6f6c6f672d73656e7472792d68616e646c65723f7374796c653d666c61742d737175617265)](LICENCE)

It is a [Monolog](https://github.com/Seldaek/monolog) handler for Sentry PHP SDK v2, v3 and v4 with breadcrumbs support.

[![Sentry event example](doc/sentry-event-example.png)](doc/sentry-event-example.png)

Features
--------

[](#features)

- Send each log record to a [Sentry](https://sentry.io) server
- Send log records as breadcrumbs when they are handled in batch; the main reported log record is the one with the highest log level
- Send log along with exception when one is set in the main log record context
- Customize data sent to Sentry to fit your needs
- Compatible with Monolog 1, 2 and 3

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

[](#installation)

The suggested installation method is via [composer](https://getcomposer.org/):

```
# For Sentry PHP SDK v3/v4
composer require bgalati/monolog-sentry-handler

# For Sentry PHP SDK v2
composer require bgalati/monolog-sentry-handler:^1.2
```

Basic usage
-----------

[](#basic-usage)

```
