PHPackages                             forci/catchable-bundle - 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. forci/catchable-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

forci/catchable-bundle
======================

A bundle to collect your unhandled exceptions

v0.8.9(4mo ago)010.4k[5 PRs](https://github.com/forci/catchable-bundle/pulls)MITCSSPHP &gt;=8.0

Since Mar 3Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/forci/catchable-bundle)[ Packagist](https://packagist.org/packages/forci/catchable-bundle)[ RSS](/packages/forci-catchable-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (7)Versions (36)Used By (0)

Register the bundle as usual and mount its routing.

For this bundle to make any sense at all, you need to create a separate connection and a separate entity manager. From version 0.7 and up, you no longer need any config for this bundle. Follow [https://symfony.com/doc/4.4/doctrine/multiple\_entity\_managers.html](https://symfony.com/doc/4.4/doctrine/multiple_entity_managers.html) and map `ForciCatchableBundle` to your separate EM.

Better yet, create a completely separate database. Having a separate entity manager will also mean you will NOT be able to migrate this with `DoctrineMigrationsBundle` as it does NOT support multiple entity managers (at least to my knowledge). So create/update your separate database as per your project's deployment strategy and/or needs.

The above configuration uses the default one and WILL NOT WORK in case you have an exception thrown by Doctrine, as it will also close the entity manager which is responsible for writing it to the database.

WARNING: This bundle is NOT meant to be a replacement for your file or else logging. It is meant to work alongside your existing infrastructure and make viewing errors easier and nicer via your admin interface.

Versions &gt;= ~0.6
-------------------

[](#versions--06)

In your config\_prod.yml

```
monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: critical
            handler:      grouped
            # 404 and 405 can build up tons if unnecessary data
            # You may be better off tracking those from your web server's logs
            excluded_http_codes: [404, 405]
            # Alternatively, exclude just 404s at given paths
#            excluded_404s:
#                # regex: exclude all 404 errors from the logs
#                - ^/
        grouped:
            type:    group
            members: [streamed, buffered, catchable]
        # Log errors to a file
        streamed:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            include_stacktraces: true
        # Buffer errors to be sent via swift mailer
        buffered:
            type:    buffer
            handler: swift
        # Actual swift mailer handler that gets invoked when action_level: critical
        # from the main handler occurs
        swift:
            type:       swift_mailer
            from_email: errors@some-domain.com
            to_email:   "dev1@some-domain.com"
            # or list of recipients
            # to_email:   [dev1@some-domain.com, dev2@some-domain.com, ...]
            subject:    "[My Project] An Error in PROD Occurred!"
            level:      debug
            include_stacktraces: true
        # CatchableBundle's buffer handler. Logs are formatted using the hardcoded \Monolog\Formatter\ScalarFormatter
        # and stored locally in an array. After that, upon an Exception, the `Forci\Bundle\Catchable\Subscriber\ExceptionSubscriber`
        # is invoked, and fetches the logs from this buffer handler. This allows you to have your Symfony logs persisted
        # together with the serialized \Throwable instance.
        catchable:
            type: service
            id: forci.catchable.monolog.handler.log_buffer
```

You could also pass Catchable's logs through a FilterHandler to get rid of bloat such as deprecations. This allows you to only have critical error information persisted, but deprecations logged to a file by the remaining handlers. Either use accepted\_levels or min\_level / max\_level, whichever suits your needs best. Just be careful if allowing deprecations to be persisted. Upon many 404 errors, you'll get the database fill up quickly with redundant data. In the future, functionality like ignored errors (such as the aforementioned HttpNotFoundException) will be added.

```
        catchable:
            type: filter
            handler: catchable_real
            # Either
#            min_level: debug
#            max_level: emergency
            # Or
            accepted_levels: [debug, critical]
        catchable_real:
            type: service
            id: forci.catchable.monolog.handler.log_buffer
```

Alternatively, instead of fingers\_crossed, you could use a filter or buffer or any other handler. Please note: When using buffer, it must flush at some point. This must also happen BEFORE the ExceptionSubscriber is fired. As it is, using it alongside your fingers\_crossed file and/or email logging is the best approach. Other handlers haven't been tested with Catchable's buffer service. Use at your own risk.

```
monolog:
    handlers:
        # Filter logs to a level you'd like
        filter:
            type: filter
            level: debug
            handler: catchable
        # Then channel them into Catchable's buffer for use by the ExceptionSubscriber as described above
        catchable:
            type: service
            id: forci.catchable.monolog.handler.log_buffer
```

Versions &lt;= ~0.5
-------------------

[](#versions--05)

In your config.yml

```
forci_catchable:
    entity_manager: default
```

Where `entity_manager` is your SEPARATE entity manager.

In your config\_prod.yml

```
monolog:
    handlers:
        limitless:
            type: service
            id: forci.catchable.handler.limitless_buffer
```

This handler will collect all the logs and store them in an array, which will be available for Catchable's subscriber and saved to the database Exception entry.

This also makes it possible for you to use the logger and log critical data that may be important in case of a disaster.

Then, make a link somewhere in your app to

```

    Errors

```

Enjoy!

Release 0.6
-----------

[](#release-06)

- Improved buffer handler. You can now configure it in your main chain of handlers.
- Removed deprecations. Allows Symfony 5 compatibility.
- Now uses `FlattenException` from Symfony's `ErrorHandler` component, rather than `Debug`.
- Removed hack around serializing `\Throwable` via the deprecated `FatalThrowableError` class.

Upgrade 0.5 -&gt; 0.6
---------------------

[](#upgrade-05---06)

- Symfony requirements are now ~4.4|~5.0
- The `Forci\Bundle\Catchable\Serializer\ExceptionSerializer` service is removed. All of its code are now in `Forci\Bundle\Catchable\Collector\ThrowableCollector`
- The `forci.catchable.handler.limitless_buffer` service has been removed in favor of a simpler `forci.catchable.monolog.handler.log_buffer`
- Your buffering and/or filtering logic must now be handled by any of the built-in Monolog handlers. This makes buffering relevant logs more streamlined and in line with your other handlers.

\--

TODOs

- Make it possible to ignore an exception class
- Add a "Hide User Deprecated" checkbox that hides log messages starting with "User Deprecated"
- Add file and message hashes, search by hash instead for better performance as these are text and have no indexes (Blame Doctrine for not allowing to specify index length)
- Rename to ExceptionBundle, ExceptionCollector, ExceptionSerializer, etc
- Add filter exceptions config
- Hash Error type, file, line, message, current DATE/HOUR and increment an "occurrences" counter @ Catchable Entity

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance78

Regular maintenance activity

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 80.5% 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 ~100 days

Recently: every ~378 days

Total

30

Last Release

122d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.1.3

v0.8.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/56129a0e9c0044d2857f405e0cf44b1c8f53bc86503dfc1c0ac3829401333c5e?d=identicon)[wucdbm](/maintainers/wucdbm)

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

---

Top Contributors

[![wucdbm](https://avatars.githubusercontent.com/u/1559022?v=4)](https://github.com/wucdbm "wucdbm (66 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")

---

Tags

wucdbmforciexception bundle

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/forci-catchable-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/forci-catchable-bundle/health.svg)](https://phpackages.com/packages/forci-catchable-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)[prestashop/prestashop

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

9.1k16.8k](/packages/prestashop-prestashop)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)

PHPackages © 2026

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