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

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

webiik/error
============

The Error provides more control over displaying and logging PHP errors.

1.1(6y ago)0661MITPHPPHP &gt;=7.2

Since Mar 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/webiik/error)[ Packagist](https://packagist.org/packages/webiik/error)[ Docs](https://www.webiik.com)[ RSS](/packages/webiik-error/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

[![](https://camo.githubusercontent.com/a397347ee4fb199934fee6354504f4702b89f5c22f0ce0ba94c5ff691cde545c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77656269696b2f77656269696b2e737667)](https://camo.githubusercontent.com/a397347ee4fb199934fee6354504f4702b89f5c22f0ce0ba94c5ff691cde545c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77656269696b2f77656269696b2e737667)[![](https://camo.githubusercontent.com/20f4b99a958aadb02ff273ac6428c17cf55c6b817657ed64b1c39c7f71955a0e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e636965732d302d627269676874677265656e2e737667)](https://camo.githubusercontent.com/20f4b99a958aadb02ff273ac6428c17cf55c6b817657ed64b1c39c7f71955a0e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e636965732d302d627269676874677265656e2e737667)

Error
=====

[](#error)

The Error provides more control over displaying and logging PHP errors.

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

[](#installation)

```
composer require webiik/error
```

Example
-------

[](#example)

```
$error = new \Webiik\Error\Error();
```

Silent mode
-----------

[](#silent-mode)

### setSilent

[](#setsilent)

```
setSilent(bool $bool): void
```

**setSilent()** activates or deactivates silent mode. When Error is not in silent mode it halts code execution on every error and then it displays error message. In silent mode instead of displaying error message a custom error page is shown and some errors can be completely ignored.

```
$error->setSilent(true);
```

### setSilentPageContent

[](#setsilentpagecontent)

```
setSilentPageContent(string $string): void
```

**setSilentPageContent()** sets custom error page to be shown when error occurs in silent mode.

```
$error->setSilentPageContent('Ups! Kitten lost!');
```

### setSilentIgnoreErrors

[](#setsilentignoreerrors)

```
setSilentIgnoreErrors(array $arr): void
```

**setSilentIgnoreErrors()** sets an array of [error constants](http://php.net/manual/en/errorfunc.constants.php) that will be ignored in silent mode - no custom error page will be shown and code execution will not stop.

```
$error->setSilentIgnoreErrors([
    'E_NOTICE',
    'E_USER_NOTICE',
    'E_DEPRECATED',
    'E_USER_DEPRECATED',
]);
```

Logging
-------

[](#logging)

### setErrLogDefLevel

[](#seterrlogdeflevel)

```
setErrLogDefLevel(string $level): void
```

**setErrLogDefLevel()** associates PSR-3 log level to all PHP error constant. The default value is *warning*.

```
$error->setErrLogDefLevel('error');
```

> Note: Please keep on mind that [PHP error constant](http://php.net/manual/en/errorfunc.constants.php) (eg. E\_NOTICE) and [PSR-3 log level](https://www.php-fig.org/psr/psr-3/) (eg. notice) are two different things and there is no connection between them.

### setErrLogLevel

[](#seterrloglevel)

```
setErrLogLevel(array $assocArr): void
```

**setErrLogLevel()** associates PSR-3 log level to specific PHP error constant. Default values are shown in the example below.

```
$error->setErrLogLevel([
    'Exception' => 'error',
    'E_ERROR' => 'error',
]);
```

### setLogService

[](#setlogservice)

```
setLogService(callable $function): void
```

**setLogService()** sets custom logger logging errors. **function** is injected with the following parameters: **string $level, string $message, array $data**. By default all PHP errors are logged with **error\_log()**.

```
$error->setLogService(function ($level, $message, $data) {
    // $level - PSR-3 log level
    // $message - Re-fromatted error message
    // $data - ['error type' => $errType, 'file' => $file, 'line' => $line, 'error message' => $message, 'trace' => $trace]
    // Your custom logger...
});
```

Resources
---------

[](#resources)

- [Webiik framework](https://github.com/webiik/webiik)
- [Report issue](https://github.com/webiik/components/issues)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~132 days

Total

2

Last Release

2472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1226362d003d186b45e7dfa44489c36af37196c6a1b476206700eaf4e9c96a5a?d=identicon)[Jiri Mihal](/maintainers/Jiri%20Mihal)

---

Top Contributors

[![Jiri-Mihal](https://avatars.githubusercontent.com/u/10408123?v=4)](https://github.com/Jiri-Mihal "Jiri-Mihal (173 commits)")

---

Tags

logexceptionerror

### Embed Badge

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

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

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[baibaratsky/yii2-rollbar

Rollbar for Yii2

35130.5k](/packages/baibaratsky-yii2-rollbar)[facile-it/sentry-module

This module allows integration of Sentry Client into laminas and mezzio

19372.5k](/packages/facile-it-sentry-module)[phptek/sentry

Sentry.io integration for SilverStripe. Binds Sentry.io to SilverStripe's error &amp; exception handling subsystem.

15203.5k3](/packages/phptek-sentry)[crisu83/yii-sentry

Sentry for the Yii PHP framework.

1110.8k](/packages/crisu83-yii-sentry)

PHPackages © 2026

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