nietonfir/raygun-bundle
Composer 安装命令:
composer require nietonfir/raygun-bundle
包简介
Symfony2 bundle for integrating mindscape/raygun4php
README 文档
README
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.
Installation
Install the latest version with
$ composer require nietonfir/raygun-bundle
Configuration
Add your raygun api-key in parameters.yml:
# app/config/parameters.yml parameters: […] raygun_api_key: <your_raygun_api-key>
Update config.yml with the following configuration:
# app/config/config.yml nietonfir_raygun: api_key: %raygun_api_key%
Enable the bundle:
// app/AppKernel.php $bundles = [ […] new Nietonfir\RaygunBundle\NietonfirRaygunBundle(), ];
Basic Usage
Register the raygun monolog handler in config_prod.yml as the first monolog handler.
# 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.:
{# 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:
{% 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
统计信息
- 总下载量: 5.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-27