PHPackages                             keboola/api-error-control - 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. keboola/api-error-control

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

keboola/api-error-control
=========================

API Error control library - Utility classes for implementing logging in a KBC API

5.0.0(5mo ago)040.6k↓27.4%1MITPHPPHP ^8.2

Since Aug 17Pushed 3mo ago15 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (33)Used By (1)

API Error Control Library
=========================

[](#api-error-control-library)

[![Build Status](https://camo.githubusercontent.com/7a45e21c0b64072dac421b63574d15f5cef03d6d7797a5e9aa49591009589db9/68747470733a2f2f7472617669732d63692e636f6d2f6b65626f6f6c612f6170692d6572726f722d636f6e74726f6c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/keboola/api-error-control)[![Maintainability](https://camo.githubusercontent.com/2cf536cee00bdbad495ddb2723bf39cf8a3daaafe236a9406f8bbbae1772e0d1/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38323039643963653338383337366432346366382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/keboola/api-error-control/maintainability)[![Test Coverage](https://camo.githubusercontent.com/d1da1e6366a44f48bc4e63c1b2ed683d82b330a462444fbf48fe2ce331dc65f9/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38323039643963653338383337366432346366382f746573745f636f766572616765)](https://codeclimate.com/github/keboola/api-error-control/test_coverage)

The library provides utility classes for catching, formatting and logging errors for KBC API backend. The provided classes are:

- `UserException` - The API code should throw this exception in case the exception should be forwarded to the end user.
- `ApplicationException` - The API code should throw this exception in case the exception should be concealed.
- `ExceptionListener` - Symfony Kernel exception listener which ensures the above described behavior, to use it put the following in `services.yaml`:

```
services:
    Keboola\ErrorControl\EventListener\ExceptionListener:
        tags:
            - { name: kernel.event_listener, event: kernel.exception }

```

- `LogProcessor` - Log processor which adds useful fields into every log message and optionally uploads full exception traces to S3. To configure, add the following to `services.yaml`:

```
services:
    Keboola\ErrorControl\Monolog\LogProcessor:
        public: true
        arguments:
            $appName: "%app_name%"
        tags:
            - { name: monolog.processor, method: processRecord }
```

*Note:* You need to have `symfony/monolog-bundle` installed for the tag `monolog.processor` to work.

- `LogInfo` - A record class used to pass additional information to the log processor. Use it in application code as:

```
/** @var LogProcessor $logProcessor */
$logProcessor = $this->container->get('Keboola\\ErrorControl\\Monolog\\LogProcessor');
$logProcessor->setLogInfo(new LogInfo(...));
```

Development
-----------

[](#development)

Use `docker-compose run dev composer ci` to run tests locally.

Migration From 3.x to 4.x
-------------------------

[](#migration-from-3x-to-4x)

Remove:

```
services:
    Keboola\ErrorControl\Uploader\UploaderFactory:
        arguments:
            $storageApiUrl: "%storage_api_url%"
            $s3Bucket: "%logs_s3_bucket%"
            $s3Region: "%logs_s3_bucket_region%"

```

Also note that 4.x uses Monolog 3.x and php &gt;= 8.1, so you will also need to support these versions

License
-------

[](#license)

MIT licensed, see [LICENSE](./LICENSE) file.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance77

Regular maintenance activity

Popularity27

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~262 days

Total

31

Last Release

161d ago

Major Versions

0.4.1 → 1.0.02019-06-19

1.0.0 → 2.0.02019-11-20

2.2.0 → 3.0.02020-07-17

3.10.1 → 4.0.02023-01-16

4.3.0 → 5.0.02025-12-09

PHP version history (7 changes)0.1.0PHP ^7.2

2.1.0PHP ^7.1

2.2.0PHP &gt;=7.1

3.6.0PHP ^7.1|^8.0

4.0.0PHP ^8.1

4.0.1PHP ^8.0

4.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/101dbf2551a0709ddab522f97669f13a2c4cc2d0a1e8d009f3af6ba80accb1a9?d=identicon)[Keboola](/maintainers/Keboola)

---

Top Contributors

[![odinuv](https://avatars.githubusercontent.com/u/4319320?v=4)](https://github.com/odinuv "odinuv (81 commits)")[![pivnicek](https://avatars.githubusercontent.com/u/569139?v=4)](https://github.com/pivnicek "pivnicek (26 commits)")[![pepamartinec](https://avatars.githubusercontent.com/u/271753?v=4)](https://github.com/pepamartinec "pepamartinec (19 commits)")[![ErikZigo](https://avatars.githubusercontent.com/u/1726727?v=4)](https://github.com/ErikZigo "ErikZigo (19 commits)")[![tomasfejfar](https://avatars.githubusercontent.com/u/642928?v=4)](https://github.com/tomasfejfar "tomasfejfar (13 commits)")[![zajca](https://avatars.githubusercontent.com/u/180148?v=4)](https://github.com/zajca "zajca (12 commits)")[![AdamVyborny](https://avatars.githubusercontent.com/u/27994036?v=4)](https://github.com/AdamVyborny "AdamVyborny (5 commits)")[![janvanicek](https://avatars.githubusercontent.com/u/26391551?v=4)](https://github.com/janvanicek "janvanicek (4 commits)")[![Halama](https://avatars.githubusercontent.com/u/903531?v=4)](https://github.com/Halama "Halama (2 commits)")[![ujovlado](https://avatars.githubusercontent.com/u/419849?v=4)](https://github.com/ujovlado "ujovlado (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/keboola-api-error-control/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k189.7M258](/packages/symfony-monolog-bridge)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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