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

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

evolutionphp/error-handler
==========================

Error Handler

v1.0(1y ago)02MITPHPPHP &gt;=8.2

Since Feb 11Pushed 1y ago1 watchersCompare

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

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

PHP Error Handler
=================

[](#php-error-handler)

Error handler and save logs in files.

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

[](#installation)

Use [Composer](http://getcomposer.org) to install Logger into your project:

```
composer require evolutionphp/error-handler
```

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

[](#configuration)

### Setup the logger

[](#setup-the-logger)

```
$config = [
	'path' => __DIR__.'/logs/',
	'ext' => 'php',
	'file_permissions' => 0644,
	'level' => 4,
	'date_format' => 'Y-m-d H:i:s'
];
$errorHandler = new \EvolutionPHP\ErrorHandler\ErrorHandler($config);
```

- path: Directory where log files will be saved.
- ext: set the extension of your log files. Leaving it blank will default to 'php'.
- file\_permissions: The file system permissions to be applied on newly created log files.
    This MUST be an integer (no quotes) and you MUST use octal integer notation (i.e. 0700, 0644, etc.)
- level: You can enable error logging by setting a level over zero. The level determines what gets logged. Threshold options are:
    0 = Disables logging, Error logging TURNED OFF
    1 = Error Messages (including PHP errors)
    2 = Debug Messages
    3 = Informational Messages
    4 = All Messages
- date\_format: Each item that is logged has an associated date. You can use PHP date codes to set your own date formatting

### Debug mode

[](#debug-mode)

```
$errorHandler = new \EvolutionPHP\ErrorHandler\ErrorHandler($config);
$errorHandler->debug();
```

### Production mode

[](#production-mode)

```
$errorHandler = new \EvolutionPHP\ErrorHandler\ErrorHandler($config);
$errorHandler->register();
```

### Write a log

[](#write-a-log)

```
$errorHandler = new \EvolutionPHP\ErrorHandler\ErrorHandler($config);
$errorHandler->write_log('error','This is an error log.')
```

### Throw an error

[](#throw-an-error)

```
$errorHandler = new \EvolutionPHP\ErrorHandler\ErrorHandler($config);
$errorHandler->alertError('This is an exception.');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance42

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d5a42f2155ba37cd77c46f9e57c613e0c08394b5e2b59e8ff77e0d44adaf907?d=identicon)[EvolutionPHP](/maintainers/EvolutionPHP)

---

Top Contributors

[![aqpdev](https://avatars.githubusercontent.com/u/143758553?v=4)](https://github.com/aqpdev "aqpdev (1 commits)")[![EvolutionPHP](https://avatars.githubusercontent.com/u/106336615?v=4)](https://github.com/EvolutionPHP "EvolutionPHP (1 commits)")

---

Tags

phperror-handler

### Embed Badge

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

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

###  Alternatives

[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2830.1k2](/packages/inspector-apm-inspector-symfony)[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)
