承接 nbeyond/raygun-exception-listener 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nbeyond/raygun-exception-listener

最新稳定版本:V1.0.2

Composer 安装命令:

composer require nbeyond/raygun-exception-listener

包简介

This packages uses the Raygun4PHP package. It makes it easier to filter the data that is being send to raygun, making your application GDPR compliant

README 文档

README

This package lets you add filters to the Raygun package (which this package is dependent on). By using this package you filter the data that is being send to Raygun in order to comply to the GDPR Law. You can also add/overwrite the filters to better suit your application.

##Installation Raygun Data Filter is dependent on Raygun4PHP, in order to use Raygun Data Filter make sure the Raygun4PHP package is working correctly

With Composer

Composer is a package management tool for PHP which automatically fetches dependencies and also supports autoloading - this is a low-impact way to get Raygun4PHP into your site.

1. If you use a *nix environment, follow the instructions to install Composer. Windows users can run this installer to automatically add it to the Path.

2. Within the project's root directory run the following console command:

php composer.phar require tripledotzero/raygun-exception-listener

3. From your shell run php composer.phar install (*nix) or composer install (Windows). This will download Raygun4PHP and create the appropriate autoload data.

##Usage You can automatically send both PHP errors and object-oriented exceptions to Raygun. The RaygunClient requires an HTTP transport (e.g. Guzzle or other PSR-7 compatible interface).

Currently, there are 2 Guzzle-based transport classes. asynchronous and synchronous. You can choose to use either the GuzzleSync or GuzzleAsync by setting setUseAsync to true.

###example code

<?php

namespace App\EventListener;

use RaygunFilterParams\Config;
use RaygunFilterParams\DataFilter;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;

class ExceptionListener
{
    public function onKernelException(ExceptionEvent $event)
    {
        $config = new Config($_ENV['RAYGUN_BASE_URI'], $_ENV['RAYGUN_API_KEY']);
        $config->setUserTracking(true);
        $dataFilter = new DataFilter($config);
        $dataFilter->sendToRaygun($event->getThrowable());
    }
}

as you can see in order to send the data to Raygun, you would first need to create the config object with the BASE_URI and API_KEY. The DisableUserTracking is turn off by default, in order to turn it on use

$config->setUserTracking(true);

it is the same for the proxy

$config->setProxy('proxy:8080');

For more information see the Raygun4PHP documentation or the Raygun website

统计信息

  • 总下载量: 10.16k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固