PHPackages                             iivannov/snitch - 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. iivannov/snitch

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

iivannov/snitch
===============

Easily log and report exceptions to multiple different places (file, database, Sentry, Bugsnag, ...)

1.0.0(8y ago)020MITPHPPHP ^7.0

Since Nov 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/iivannov/snitch)[ Packagist](https://packagist.org/packages/iivannov/snitch)[ RSS](/packages/iivannov-snitch/feed)WikiDiscussions master Synced today

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

Snitch - Report and log exceptions to multiple different places
===============================================================

[](#snitch---report-and-log-exceptions-to-multiple-different-places)

The package gives you the ability to define multiple handlers and subscribe them to accept different Exceptions that will be logged or reported. This way you can log different errors in different files, to ignore some of the errors or to save specific errors in a database and send others to a third party service.

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

[](#installation)

The package can be installed with Composer. Just run this command:

```
$ composer require iivannov/snitch
```

Supported Handlers
------------------

[](#supported-handlers)

Currently we support only two handlers:

- LoggerHandler - accepting PSR LoggerInterface::class, so you can inject any other compatible logger instance.
- SentryHandler - sends debug data to Sentry service

Any contributions are welcomed :)

Usage
-----

[](#usage)

### Initialization

[](#initialization)

We define a new SentryHandler and we tell it that all exceptions other than an \\InvalidArgumentException::class will be sent to Sentry service Then we create a new Snitch instance and add the handler.

```
$handler = new SentryHandler(YOUR_SENTRY_DSN);
$handler->ignore(\InvalidArgumentException::class);

$snitch = new Snitch();
$snitch->handler($handler);
```

### Report exceptions

[](#report-exceptions)

Snitch will check which registered handlers are accepting the given exception and they will log or report it.

```
try {
    ...
} catch (\Exception $e) {
    $snitch->report($exception, ['foo' => 'bar']);
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3105d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7932620?v=4)[Ivan Ivanov](/maintainers/iivannov)[@iivannov](https://github.com/iivannov)

---

Tags

loglaravelsentry

### Embed Badge

![Health badge](/badges/iivannov-snitch/health.svg)

```
[![Health](https://phpackages.com/badges/iivannov-snitch/health.svg)](https://phpackages.com/packages/iivannov-snitch)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[arcanedev/log-viewer

Provides a Log Viewer for Laravel

2.4k6.7M51](/packages/arcanedev-log-viewer)

PHPackages © 2026

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