PHPackages                             confetticode/error-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. confetticode/error-handler

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

confetticode/error-handler
==========================

A great unified error handler for PHP

00PHP

Since Jun 20Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/confetticode/error-handler)[ Packagist](https://packagist.org/packages/confetticode/error-handler)[ RSS](/packages/confetticode-error-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

A great unified error handler for PHP
=====================================

[](#a-great-unified-error-handler-for-php)

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

[](#installation)

Install `confetticode/error-handler` as a Composer dependency in your project.

```
composer require confetticode/error-handler
```

Usage
-----

[](#usage)

Create a new instance of the `ErrorHandler` class. By default, `HtmlDisplayer` will be initialized. This will display an error html page with status code, message and short description.

```
$errors = new \Confetti\ErrorHandler\ErrorHandler();
```

Register the `$errors` instance as the global error handler by doing some logic with `set_error_handler`, `set_exception_handler` and `register_shutdown_function`. Then, any uncaught errors/exceptions will be handled.

```
$errors->register();
```

You can change displayer by calling the `setDisplayer` method.

```
// Natively available.
$errors->setDisplayer(new \ConfetiCode\ErrorHandler\SymfonyDisplayer);

// To use IgnitionDisplayer, you have to install "spatie/ignition".
$errors->setDisplayer(new \ConfetiCode\ErrorHandler\IgnitionDisplayer);
```

Integrate with `monolog/monolog`, eg: writing logs into files.

```
composer require monolog/monolog
```

```
$logger = new \Monolog\Logger('testing');

$logger->setHandlers([
    new \Monolog\Handler\StreamHandler(__DIR__.'/log.txt'),
]);

$reporter = new \ConfettiCode\ErrorHandler\LogReporter($logger);

$errors->setReporter($reporter);
```

You may try out [error.php](./sample/error.php) file for a quick overview.

License
-------

[](#license)

The `confetticode/error-handler` package is licensed under the [MIT license](./LICENSE.md).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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/497cc36b645ca741219477098eb4bd33f99ad7a4185021b7ac173dde0b4f28d3?d=identicon)[seriquynh](/maintainers/seriquynh)

---

Top Contributors

[![oliverquynh](https://avatars.githubusercontent.com/u/16967350?v=4)](https://github.com/oliverquynh "oliverquynh (19 commits)")

### Embed Badge

![Health badge](/badges/confetticode-error-handler/health.svg)

```
[![Health](https://phpackages.com/badges/confetticode-error-handler/health.svg)](https://phpackages.com/packages/confetticode-error-handler)
```

###  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)
