PHPackages                             sfertrack/rollbar-symfony-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. sfertrack/rollbar-symfony-bundle

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

sfertrack/rollbar-symfony-bundle
================================

Symfony bundle to integrate Rollbar tracker

v4.0.5(7mo ago)026.6k↓16.5%MITPHPPHP &gt;=8.1

Since Oct 20Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/zinkovskiy/rollbar-symfony-bundle)[ Packagist](https://packagist.org/packages/sfertrack/rollbar-symfony-bundle)[ RSS](/packages/sfertrack-rollbar-symfony-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (29)Used By (0)

Introduction
============

[](#introduction)

Rollbar is one of the best bug tracking systems that supported a lot of programming languages, including PHP.

You can find their official php library [here](https://packagist.org/packages/rollbar/rollbar) and [symfony bundle](https://packagist.org/packages/rollbar/rollbar-php-symfony-bundle) that allow easily integrate rollbar to your application. Unfortunately, they announced that the bundle will not be actively developed and will be archived in January 2025:

> As of May 2024, Rollbar will not be actively updating this repository and plans to archive it in January of 2025. We encourage our community to fork this repo if you wish to continue its development. While Rollbar will no longer be engaging in active development, we remain committed to reviewing and merging pull requests related to security updates. If an actively maintained fork emerges, please reach out to our support team and we will link to it from our documentation.

So, looks like it's time to create new rollbar symfony bundle that will support actual PHP and symfony versions.

Set up instructions
===================

[](#set-up-instructions)

1. To set up the bundle you need to [sign up](https://rollbar.com/signup) rollbar account
2. Add the bundle with composer:

```
composer require sfertrack/rollbar-symfony-bundle
```

3. Create `rollbar_symfony.yaml` configuration file (if you use application structure recommended by symfony, then it should be placed to `config/packages` folder)
4. Configure your Rollbar setup in `config/packages/rollbar_symfony.yaml` or in any of the environment subdirectories:

```
rollbar_symfony:
   access_token: [rollbar access token]
```

That's it! Rollbar is integrated to your application.

For complete configuration reference take a look [official documentation](https://docs.rollbar.com/docs/php-configuration-reference)

Additional configuration
========================

[](#additional-configuration)

This bundle provides you with several services and patterns that simplify developer life like:

- [PersonProvider](#person-provider)
- [CheckIgnoreVoter](#check-ignore-voter)
- [ExceptionExtraDataProvider](#exception-extra-data-provider)
- [Scrubber](#scrubber)
- [RollbarReporter](#rollbar-reporter)
- [IgnoreExceptionInterface](#ignore-exception-interface)
- [AbstractExtraDataException](#ignore-exception-interface)
- [UserFriendlyExceptionInterface](#user-friendly-exception-interfacce)
- [Scrubbing environment variables](#scrubbing-environment-variables)

PersonProvider service
----------------------------------------------------------------

[](#personprovider-service-)

The service automatically collects information about authenticated users if your application uses [symfony/security-bundle](https://github.com/symfony/security-bundle). No extra configuration is needed.

If you use impersonation feature, the service will also collect information about the impersonator.

To collect user information, the service uses Symfony serializer. You can easily define which fields you want to report to Rollbar by configuring user entity serialization groups.

If you want to implement your own service to collect user information, simply implement [PersonProviderInterface](src/Service/PersonProvider/PersonProviderInterface.php)

You can define several person provider services if your application has a complex authentication flow. All services that implement [PersonProviderInterface](src/Service/PersonProvider/PersonProviderInterface.php) are called in turn, until one of them returns user data.

PersonProvider that comes with this bundle has a priority of `-1` and is called last, in case previous services couldn't provide user data.

Exceptions thrown by person provider services don't stop the call queue. So, don't worry if your person provider service throws an exception - the original exception will still be delivered to Rollbar.

**(!) Note: If a person provider service returns an array without an `id` key, Rollbar [won't report](https://github.com/rollbar/rollbar-php/blob/master/src/DataBuilder.php#L933) user data at all**

CheckIgnoreVoter
-------------------------------------------------------------

[](#checkignorevoter-)

Sometimes we don't need to see noisy exceptions when a route is not found, a method is not allowed, access is denied, or similar issues occur. For these cases, Rollbar has a `check_ignore` option.

You can define your own service to ignore exceptions with custom rules. To do this, simply implement [CheckIgnoreVoterInterface](src/Service/CheckIgnore/CheckIgnoreVoterInterface.php).

The bundle allows you to create several voters, as the logic to ignore exceptions can be quite complex. All voters that implement the interface will be called one by one until one of them votes to ignore the occurred exception. If this doesn't happen, the exception will be reported to Rollbar.

For you convenience the bundle includes an example: [CheckIgnoreVoter](src/Service/CheckIgnore/CheckIgnoreVoter.php). If you want to use it, you can simply define the class as a service in your configuration files.

ExceptionExtraDataProvider
----------------------------------------------------------------------------------

[](#exceptionextradataprovider-)

The bundle provides an interface for exceptions that allows easy passing of additional context to reported exceptions. Typically, developers include this context in exception messages, but this approach becomes inconvenient, especially when the context contains responses from other services.

To address this issue, the bundle includes [ExceptionExtraDataInterface](src/Service/Exception/ExceptionExtraDataInterface.php). This interface defines only one method: `getExtraData`. When a thrown exception implements `ExceptionExtraDataInterface`, `getExtraData` method is called to retrieve the additional data previously passed by the developer. It's assumed that this data is passed through the constructor when the exception is created.

Scrubber
-------------------------------------------

[](#scrubber-)

By default, Rollbar provides a scrubber that allows you to scrub specific values by key. Take a look on `scrub_fields` option

Sometimes, you need to scrub cookie values, such as user sessions, but still want to see other cookies in the occurrence details.

To resolve this problem, the bundle includes [CookieScrubber](https://github.com/zinkovskiy/rollbar-symfony-bundle/blob/a2b80d6d6f26479466423e9efa784f1e89a6e677/src/Service/Scrubber/CookieScrubber.php)

This scrubber is enabled by default. List of keys to be scrubbed can be configured using the `scrub_cookie_fields` option

You can also add your own scrubber, here are two ways to do it:

- create a service that implements [ScrubberInterface](https://github.com/zinkovskiy/rollbar-symfony-bundle/blob/a2b80d6d6f26479466423e9efa784f1e89a6e677/src/Service/Scrubber/ScrubberInterface.php) defined by this bundle or
- create a service that implements [ScrubberInterface](https://github.com/rollbar/rollbar-php/blob/master/src/ScrubberInterface.php) from rollbar package and add tag `rollbar.scrubber` to the service

RollbarReporter
----------------------------------------------------------

[](#rollbarreporter-)

You might occasionally need to catch an exception, handle it, and log it to Rollbar, especially to track down tricky issues.

[RollbarReporter](https://github.com/zinkovskiy/rollbar-symfony-bundle/blob/05bd9efaaca62c3de1165feb06aa62dd292f1927/src/Service/RollbarReporter.php#L11) can assist you with this.

IgnoreExceptionInterface
------------------------------------------------------------------------------

[](#ignoreexceptioninterface-)

[IgnoreExceptionInterface](src/Service/IgnoreExceptionInterface.php) is designed to ignore exceptions. The interface is used by [CheckIgnoreVoter](src/Service/CheckIgnore/CheckIgnoreVoter.php). Therefore, if you do not want to report some of your exceptions, they just need to implement this interface.

AbstractExtraDataException
----------------------------------------------------------------------------------

[](#abstractextradataexception-)

Developers sometimes encounter cases where they need to add extra data to already thrown exceptions that implement [ExceptionExtraDataInterface](src/Service/Exception/ExceptionExtraDataInterface.php).

To handle such cases, [AbstractExtraDataException](src/Service/Exception/AbstractExtraDataException.php) was designed. It implements the `ExceptionExtraDataInterface::getExtraData` method and introduces an abstract method, `getExceptionExtraData`, which should provide data passed to the exception's constructor.

The abstract class also has an `addExtraDataItem` method that adds a value to the protected `extraData` field. When `getExtraData` method is called, any extra data passed to the exception's constructor will be merged with any additional extra data items added later, and returned as a single array.

Example you can see in test: [PayOrderController](tests/App/Controller/PayOrderController.php)

UserFriendlyExceptionInterface
-------------------------------------------------------------------------------------------

[](#userfriendlyexceptioninterface-)

Sometimes, exception messages may contain technical information; displaying these messages to users is not good practice.

[UserFriendlyExceptionInterface](src/Service/UserFriendlyExceptionInterface.php) is designed to distinguish exceptions whose messages are user-friendly and can be displayed to the user. Typically, these types of exceptions do not require a fix from developers; instead, users should perform certain actions themselves.

Imagine your developed application depends on an external service. Occasionally, this service might be broken and return a 5xx error. In such a case, you can throw your own exception that implements UserFriendlyExceptionInterface. You can rely on this interface and simply display the exception message to the user.

For example:

```
use SFErTrack\RollbarSymfonyBundle\Service\Exception\UserFriendlyExceptionMessageInterface;

final FailedDependencyException extends Exception implements UserFriendlyExceptionMessageInterface {
    public function getUserFriendlyMessage()
    {
        return 'Unfortunately zoom service is down, please try again later';
    }
}
```

Scrubbing environment variables
-----------------------------------------------------------------------------------------

[](#scrubbing-environment-variables-)

Scrubbing production application secrets is a good practice. By default, the Rollbar package dumps local environment variables, as the `local_vars_dump` option is enabled by default. The Symfony HTTP request object has a [server](https://github.com/symfony/http-foundation/blob/7.3/Request.php#L103) field that contains environment variables. These environment variables may contain secret keys, such as a database DSN. You will likely want to keep these values hidden, especially from junior developers.

Here are two possible ways to keep environment variables hidden:

- Add all environment variable names to the `scrub_fields` option of the Rollbar configuration. In this case, Rollbar will scrub the values of the listed environment variables. However, you should keep in mind, that every time a new sensitive environment variable is added, it must also be added to the `scrub_fields` list.
- Rely on the `scrub_env_variables` option, provided by the bundle (this option is enabled by default). When this option is enabled, all environment variables will be scrubbed. If you do not want to scrub a specific variable, you can add its name to the `scrub_safelist` configuration option. You might also notice that some secrets can be passed to a service as method arguments, these values will also be dumped, and the secret value will be disclosed. The bundle takes care of this as well and scrubs such values.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance64

Regular maintenance activity

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

24

Last Release

218d ago

Major Versions

v1.4.0 → v2.0.02025-06-25

v2.2.0 → v3.0.02025-06-26

v3.0.3 → v4.0.02025-08-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1dc7b365a2e6c684ed9ded8258ed568886e75104c76c0ea3588704cf5911673?d=identicon)[zinkovskiy.as](/maintainers/zinkovskiy.as)

---

Top Contributors

[![zinkovskiy](https://avatars.githubusercontent.com/u/13371162?v=4)](https://github.com/zinkovskiy "zinkovskiy (96 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/sfertrack-rollbar-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sfertrack-rollbar-symfony-bundle/health.svg)](https://phpackages.com/packages/sfertrack-rollbar-symfony-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[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)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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