2017 © Pedro Peláez
 

symfony-bundle raygun-bundle

Symfony2 bundle for integrating mindscape/raygun4php

image

nietonfir/raygun-bundle

Symfony2 bundle for integrating mindscape/raygun4php

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 10 Versions
  • 7 % Grown

The README.md

RaygunBundle

Raygun4PHP is a Raygun.io provider for PHP 5.3+. Raygun4js is a is a Raygun.io plugin for JavaScript. This bundle registers the library with the framework and provides a twig template for the plugin., (*1)

Latest Stable Version Latest Unstable Version License, (*2)

Installation

Install the latest version with, (*3)

$ composer require nietonfir/raygun-bundle

Configuration

Add your raygun api-key in parameters.yml:, (*4)

# app/config/parameters.yml
parameters:
    […]
    raygun_api_key: <your_raygun_api-key>

Update config.yml with the following configuration:, (*5)

# app/config/config.yml
nietonfir_raygun:
    api_key: %raygun_api_key%

Enable the bundle:, (*6)

// app/AppKernel.php
$bundles = [
    […]
    new Nietonfir\RaygunBundle\NietonfirRaygunBundle(),
];

Basic Usage

Register the raygun monolog handler in config_prod.yml as the first monolog handler., (*7)

# app/config/config_prod.yaml
monolog:
    handlers:
        raygun:
            type: service
            id:   raygun.handler
        main:
            type:         fingers_crossed
            action_level: error
            handler:      nested

To use the JavaScript client include the bundled views in your template at their designated places according to the raygun documentation. NietonfirRaygunBundle:Static:raygun-js.html.twig provides the javascript client and NietonfirRaygunBundle::setup.html.twig configures it, e.g.:, (*8)

{# snip #}
{% include 'NietonfirRaygunBundle:Static:raygun-js.html.twig' %}
</head>
<body>

{# snip #}
{% include 'NietonfirRaygunBundle::setup.html.twig' %}
</body>

If you wish to override any part of the templates you can use the default Symfony mechanisms. A global twig parameter (raygun_api_key) is exposed by a custom Twig_Extension that provides the API key. Raygun pulse can be enabled by either setting or passing a truthy variable named enable_pulse to the template:, (*9)

{% include 'NietonfirRaygunBundle::setup.html.twig' with {'enable_pulse': true} only %}

Configuration Reference

# app/config/config.yml
nietonfir_raygun:
    api_key: %raygun_api_key% # Your Raygun API key, available under "Application Settings" in your Raygun account.
    async: true               # Sets the [async configuration option](https://github.com/MindscapeHQ/raygun4php#sending-method---asyncsync) on the Raygun client.
    debug_mode: false         # Sets the [debug configuration option](https://github.com/MindscapeHQ/raygun4php#debug-mode) on the Raygun client.
    ignore_404: false         # Whether to send 404 exceptions (NotFoundHttpException) to Raygun

The Versions