PHPackages                             aloframework/handlers - 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. aloframework/handlers

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

aloframework/handlers
=====================

The error and exception handlers of AloFramework

3.0(9y ago)02302Apache-2.0PHPPHP &gt;=5.5.9

Since Sep 19Pushed 9y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (26)Used By (2)

AloFramework | Handlers
=======================

[](#aloframework--handlers)

A powerful error and exception handler of [AloFramework](https://github.com/aloframework/aloframework). It can automatically log errors and exceptions if an object implementing the [\\Psr\\Log\\LoggerInterface](https://packagist.org/packages/psr/log) is passed on and will echo output based on your server's error reporting settings, altering its format depending on whether an error is raised during a HTTP or CLI call.

Latest release API documentation:

[![License](https://camo.githubusercontent.com/0d1c39627f8a714d1695e26a81b3051c4690467909ae9c5ebe0b825e9c316979/68747470733a2f2f706f7365722e707567782e6f72672f616c6f6672616d65776f726b2f68616e646c6572732f6c6963656e73653f666f726d61743d706c6173746963)](https://camo.githubusercontent.com/0d1c39627f8a714d1695e26a81b3051c4690467909ae9c5ebe0b825e9c316979/68747470733a2f2f706f7365722e707567782e6f72672f616c6f6672616d65776f726b2f68616e646c6572732f6c6963656e73653f666f726d61743d706c6173746963)[![Latest Stable Version](https://camo.githubusercontent.com/d43bcf8415229d6dd02bb2d575cd7cb67c1b52e6a70158cd198b9e76168c3260/68747470733a2f2f706f7365722e707567782e6f72672f616c6f6672616d65776f726b2f68616e646c6572732f762f737461626c653f666f726d61743d706c6173746963)](https://packagist.org/packages/aloframework/handlers)[![Total Downloads](https://camo.githubusercontent.com/cd14a803086c580cf1a910c0568e00048bfd9acd3105dbfc6fc49fbbdf0ff9d8/68747470733a2f2f706f7365722e707567782e6f72672f616c6f6672616d65776f726b2f68616e646c6572732f646f776e6c6f6164733f666f726d61743d706c6173746963)](https://packagist.org/packages/aloframework/handlers)

dev-developLatest release[![Dev Build Status](https://camo.githubusercontent.com/f30787b6c821c6ee0f5c9957a3e65d646100db356e1b626912ccc40c6a73c8f9/68747470733a2f2f7472617669732d63692e6f72672f616c6f6672616d65776f726b2f68616e646c6572732e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/aloframework/handlers)[![Release Build Status](https://camo.githubusercontent.com/10a3bebc1f6dca02fe3d5ae57b7836931332ebff12b552650d4e1d13408fb433/68747470733a2f2f7472617669732d63692e6f72672f616c6f6672616d65776f726b2f68616e646c6572732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aloframework/handlers)[![Coverage Status](https://camo.githubusercontent.com/03e6f29db1eb11025bfb951fd4211652497b4a0c50d1e5364f4596adad344f19/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f616c6f6672616d65776f726b2f68616e646c6572732f62616467652e7376673f6272616e63683d646576656c6f7026736572766963653d676974687562)](https://coveralls.io/github/aloframework/handlers?branch=develop)[![Coverage Status](https://camo.githubusercontent.com/7d3e05194025088a1bfde5fba00135701633e6f772d3ce0de99ae15b80a99832/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f616c6f6672616d65776f726b2f68616e646c6572732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/aloframework/handlers?branch=master)Installation
------------

[](#installation)

Installation is available via Composer:

```
composer require aloframework/handlers

```

Usage
-----

[](#usage)

- To enable the exception handler call `\AloFramework\Handlers\ExceptionHandler::register()`
- To enable the error handler call `\AloFramework\Handlers\ErrorHandler::register()`
- To enable the shutdown handler call `\AloFramework\Handlers\ShutdownHandler::register()`

### Logging

[](#logging)

Every error and exception has to be logged in this package. You can supply your own logger to have more control; if you don't, [aloframework/log](https://github.com/aloframework/log) will be used with its default settings.

Configuration
-------------

[](#configuration)

Configuration is done via the classes in the `AloFramework\Handlers\Config` namespace.

### Common

[](#common)

- `CFG_CSS_PATH` - path to the CSS file which will style the HTML output. Defaults to **error.min.css** in the src directory.
- `CFG_TRACE_MAX_DEPTH` - maximum number of debug backtrace items to display \[**50**\]
- `CFG_BACKGROUND` - CLI output background colour \[**default**\]
- `CFG_FOREGROUND_NOTICE` - CLI output notice level foreground colour \[**cyan**\]
- `CFG_FOREGROUND_WARNING` - CLI output warning level foreground colour \[**yellow**\]
- `CFG_FOREGROUND_ERROR` - CLI output error/exception level foreground colour \[**red**\]
- `CFG_FORCE_HTML` - Whether to force HTML output even in CLI mode \[**false**\]

### Error Handlers' Config

[](#error-handlers-config)

- `CFG_ERROR_LEVEL` - Which error levels to handle. Defaults to the value of `error_reporting()`.
- `CFG_LOG_ERROR_LOCATION` - Whether to include the error location in the log \[**true**\]

### Exception Handlers' Config

[](#exception-handlers-config)

- `CFG_EXCEPTION_DEPTH` - Maximum number previous exceptions to output in the exception handler \[**10**\]
- `CFG_LOG_EXCEPTION_LOCATION` Whether to include the exception location in the log \[**true**\]

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~92 days

Total

24

Last Release

3479d ago

Major Versions

0.2 → 1.02015-09-20

1.4.1 → 2.0-beta.12015-10-20

2.0.4 → 3.02016-11-07

PHP version history (2 changes)0.1PHP &gt;=5.4

2.0.2PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/cca267ade0c44a740c602ca62e377789418696ad942cbd1e3d59100b9928f1a2?d=identicon)[Alorel](/maintainers/Alorel)

---

Top Contributors

[![Alorel](https://avatars.githubusercontent.com/u/4998038?v=4)](https://github.com/Alorel "Alorel (110 commits)")

---

Tags

phpexceptionerrorhandlerconfigurableshutdown

### Embed Badge

![Health badge](/badges/aloframework-handlers/health.svg)

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

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[e2ex/e2ex

Converts PHP Errors to Exceptions and (optionally) logs PHP Errors, Notices and Warnings with a PSR-3 compatible logger

101.5k](/packages/e2ex-e2ex)

PHPackages © 2026

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