PHPackages                             evolution7/bugsnag-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. evolution7/bugsnag-bundle

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

evolution7/bugsnag-bundle
=========================

Bugsnag error reporting integration for Symfony2

2.0.1(9y ago)19126.5k7[1 issues](https://github.com/evolution7/Evolution7BugsnagBundle/issues)1MITPHP

Since Jan 13Pushed 9y ago9 watchersCompare

[ Source](https://github.com/evolution7/Evolution7BugsnagBundle)[ Packagist](https://packagist.org/packages/evolution7/bugsnag-bundle)[ Docs](https://github.com/evolution7/Evolution7BugsnagBundle)[ RSS](/packages/evolution7-bugsnag-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (14)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/8c3a14afca5115a50f239f551d750d70a91c1692afc4642183e5bc845a7b794e/68747470733a2f2f706f7365722e707567782e6f72672f65766f6c7574696f6e372f627567736e61672d62756e646c652f762f737461626c65)](https://packagist.org/packages/evolution7/bugsnag-bundle) [![Total Downloads](https://camo.githubusercontent.com/d00be45942b19aa885d6e8f8ea5f2599f8460ab05d0c6e64c68afb72197eb1ba/68747470733a2f2f706f7365722e707567782e6f72672f65766f6c7574696f6e372f627567736e61672d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/evolution7/bugsnag-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/54490757cf9fd0bccee420a8fb6f328bbe94855e2c9dbf01319ca79093fa2a8e/68747470733a2f2f706f7365722e707567782e6f72672f65766f6c7574696f6e372f627567736e61672d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/evolution7/bugsnag-bundle) [![License](https://camo.githubusercontent.com/241c404f3015a57c0d1a9102fd74f2109b654f8887d1b2e054b5249147ec70d9/68747470733a2f2f706f7365722e707567782e6f72672f65766f6c7574696f6e372f627567736e61672d62756e646c652f6c6963656e7365)](https://packagist.org/packages/evolution7/bugsnag-bundle)

Evolution7BugsnagBundle
=======================

[](#evolution7bugsnagbundle)

Enables Bugsnag integration into your Symfony application, using the [bugsnag-php](https://github.com/bugsnag/bugsnag-php) 2.x library from Bugsnag.

Installation
============

[](#installation)

The recommended way of installing this bundle is using [Composer](http://getcomposer.org/).

Add this repository to your composer information using the following command

```
composer require "evolution7/bugsnag-bundle:~2.0"
```

Add the bundle to your AppKernel.php:

```
$bundles = array(
    //Other Bundles
    new Evolution7\BugsnagBundle\BugsnagBundle(),
```

Define your Bugsnag API key in the config.yml

```
bugsnag:
    api_key: YOUR-API-KEY
```

Usage
=====

[](#usage)

After the installation the bundle works without any additional settings required, but you can tweak some settings.

Enabled Stages
--------------

[](#enabled-stages)

You can set for which Symfony environments (`kernel.environment`) you want Bugsnag to be enabled. This is done through the enabled\_stages setting:

```
bugsnag:
    enabled_stages: [dev, prod, staging]
```

These environments should match the environment as set in your application's `web/app.php`, `web/app_dev.php` and/or `app/console`. The default is to report bugs for the `prod` environment only.

Notify Stages
-------------

[](#notify-stages)

You can set for which environments you want Bugsnag to get error reports. This is done with the notify\_stages setting:

```
bugsnag:
    notify_stages: [development, staging, production]
```

The default is to report bugs in staging and production environments.

Proxy
-----

[](#proxy)

If your server requires you to access Bugsnag through a proxy, you can set this up easily as well. Just use the following example to configure the settings you need in your config.yml:

```
bugsnag:
    proxy:
        host: www.bugsnag.com
        port: 42
        user: username
        password: password
```

The only of these settings that is mandatory is the host, all others can be left out if they aren't required.

AppVersion
----------

[](#appversion)

If you tag your app releases with version numbers, Bugsnag can display these on your dashboard if you set this:

```
bugsnag:
    app_version: v1.2.3
```

Testing
-------

[](#testing)

Included in the bundle is a controller that will allow you to test if your site is hooked up correctly. Just add the following to your routing.yml:

```
evolution7_bugsnag_bundle:
    resource: "@BugsnagBundle/Resources/config/routing.yml"
    prefix:   /bugsnagtest
```

And then afterwards you can access `your.domain/bugsnagtest/exception` and `your.domain/bugsnagtest/error` which should then send errors to your configured Bugsnag project.

Advanced Usage
==============

[](#advanced-usage)

Release Stage Class
-------------------

[](#release-stage-class)

Bugsnag allows you to determine which release stage you are currently in, the Evolution7BugsnagBundle uses a ReleaseStage class for this which determines this based on the path. Depending on your setup you might want to have a different way of determining this, in which case it is possible to override this by providing your own ReleaseStage class. You can implement a class that implements the `Evolution7\BugsnagBundle\ReleaseStage\ReleaseStageInterface` and provide its name as a parameter in your config.yml

```
bugsnag:
    release_stage:
        class: Your\Name\Space\ClassName
```

User Information
----------------

[](#user-information)

Bugsnag gives the possibility to give userdata as additional information to a request. If you give an id, name or email these fields will be searchable. Other fields are allowed but not searchable - they will only be displayed. The bundle allows to set a user to array converter as a service which will be used to send user data. The given service must be an instance of \\Evolution7\\BugsnagBundle\\UserInterface

```
