PHPackages                             bugban/symfony - 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. bugban/symfony

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

bugban/symfony
==============

Bugban error &amp; monitoring SDK — Symfony bundle that auto-captures exceptions.

v1.5.3(1mo ago)021↓75%MITPHPPHP &gt;=7.1

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/Umid-ismayilov/bugban-symfony)[ Packagist](https://packagist.org/packages/bugban/symfony)[ RSS](/packages/bugban-symfony/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (10)Versions (12)Used By (0)

bugban/symfony
==============

[](#bugbansymfony)

Symfony bundle for the [Bugban](https://bugban.online) error &amp; monitoring SDK. It auto-captures unhandled exceptions via a `kernel.exception` listener and initializes the framework-agnostic `bugban/php-sdk` core for you.

Compatible with Symfony **3.4 → 7.x** and PHP **7.1+**.

Install
-------

[](#install)

```
composer require bugban/symfony
```

Enable the bundle
-----------------

[](#enable-the-bundle)

Add it to `config/bundles.php` (Symfony Flex / 4+):

```
// config/bundles.php
return [
    // ...
    Bugban\Symfony\BugbanBundle::class => ['all' => true],
];
```

On Symfony 3.4 (`AppKernel`), add it to `registerBundles()`:

```
public function registerBundles()
{
    $bundles = [
        // ...
        new Bugban\Symfony\BugbanBundle(),
    ];
    return $bundles;
}
```

Configure
---------

[](#configure)

Create `config/packages/bugban.yaml`:

```
bugban:
    api_key: '%env(BUGBAN_API_KEY)%'
    host: 'https://bugban.online'
    # environment: '%kernel.environment%'
    # release: '1.0.0'
    # enabled: true
    # capture_requests: false
    # capture_queries: true
    # slow_query_ms: 1000
    # sample_rate: 1.0
```

Then set your API key (e.g. in `.env`):

```
BUGBAN_API_KEY=bb_xxxxxxxxxxxxxxxx
```

That's it — unhandled exceptions are now reported to Bugban automatically.

Manual capture
--------------

[](#manual-capture)

You can also report manually anywhere in your app:

```
use Bugban\Sdk\Bugban;

try {
    // ...
} catch (\Throwable $e) {
    Bugban::capture($e);
}

// Or a message:
Bugban::captureMessage('Something noteworthy happened', 'warning');
```

Configuration reference
-----------------------

[](#configuration-reference)

KeyTypeDefault`api_key`string`''``host`string`https://bugban.online``environment`string`production``release`string`null``enabled`bool`true``capture_requests`bool`false``capture_queries`bool`true``slow_query_ms`int`1000``sample_rate`float`1.0`Slow query monitoring
---------------------

[](#slow-query-monitoring)

Doctrine's `SQLLogger` interface was removed in DBAL 4, so the bundle does **not** hook Doctrine automatically. Pick whichever fits your setup (queries faster than `slow_query_ms` are always dropped by the SDK):

- **Doctrine DBAL 2.x / 3.x** — register the bundled logger yourself (e.g. on `kernel.request` or in a decorator):

    ```
    if (interface_exists(\Doctrine\DBAL\Logging\SQLLogger::class)) {
        $connection->getConfiguration()->setSQLLogger(new \Bugban\Symfony\Doctrine\BugbanSqlLogger());
    }
    ```
- **Any DBAL version / no Doctrine** — record manually where you run queries:

    ```
    \Bugban\Sdk\Bugban::recordQuery($sql, $durationMs, ['connection' => 'mysql', 'bindings' => $params]);
    ```
- **Plain PDO** — use the drop-in `\Bugban\Sdk\Support\TracedPdo` from the core SDK.

Log capture (errors logged but not thrown)
------------------------------------------

[](#log-capture-errors-logged-but-not-thrown)

Errors you catch and log — but never re-throw — only hit the log file. Enable `capture_logs` in the SDK init and forward them to Bugban with `recordLog()`:

```
\Bugban\Sdk\Bugban::init([
    'api_key'      => 'bb_xxxxxxxx',
    'host'         => 'https://bugban.online',
    'capture_logs' => true,
    'log_level'    => 'error', // minimum PSR level forwarded
]);

// Any framework — from your log pipeline or directly:
\Bugban\Sdk\Bugban::recordLog('error', 'Import failed', ['file' => $name]);

// Caught-and-logged throwable (attach it for a full stacktrace):
try { risky(); } catch (\Throwable $e) {
    \Bugban\Sdk\Bugban::recordLog('error', $e->getMessage(), ['exception' => $e]);
}
```

**Monolog** users can register a tiny handler whose `write()` calls `Bugban::recordLog($record['level_name'] ?? $record->level->getName(), $record['message'] ?? $record->message, $record['context'] ?? $record->context)`(works for Monolog 2 arrays and Monolog 3 `LogRecord`). Records below `log_level`are dropped; context is redacted; `recordLog()` never throws.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

11

Last Release

38d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49947736?v=4)[Umid Ismayilov](/maintainers/Umid-ismayilov)[@Umid-ismayilov](https://github.com/Umid-ismayilov)

---

Top Contributors

[![Umid-ismayilov](https://avatars.githubusercontent.com/u/49947736?v=4)](https://github.com/Umid-ismayilov "Umid-ismayilov (11 commits)")

---

Tags

symfonymonitoringexceptionserror-trackingbugban

### Embed Badge

![Health badge](/badges/bugban-symfony/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.7M440](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k263.2M12.7k](/packages/symfony-framework-bundle)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86538.6k](/packages/flow-php-flow)

PHPackages © 2026

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