承接 errorstream/errorstream-laravel 相关项目开发

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

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

errorstream/errorstream-laravel

最新稳定版本:4.1

Composer 安装命令:

composer require errorstream/errorstream-laravel

包简介

Laravel Package for ErrorStream.com integration

README 文档

README

Laravel integration with Errorstream.

#Installation Instructions

First, run the following command on the terminal to download and install the package

composer require errorstream/errorstream-laravel 3.*

Next, register the service provider in the config/app.php file.

'providers' => [
     // ...
     ErrorStream\ErrorStream\ErrorStreamServiceProvider::class,
]

Then add the Facade to the aliases array in the config/app.php file.

'aliases' => [
    // ...
    'ErrorStream' => ErrorStream\ErrorStream\Facades\ErrorStream::class,
]

Then hook into the App/Exceptions/Handler.php file to send errors to our service.

public function report(Exception $e)
{
    if ($this->shouldReport($exception) && config('services.errorstream.enabled')) {
        ErrorStream::reportException($exception);
    }
     parent::report($e);
}

Add the following two configuration entries into .env. You can find your API key and project token on the project settings page for the project you wish to integrate.

ERROR_STREAM_API_TOKEN=YOUR_API_TOKEN
ERROR_STREAM_PROJECT_TOKEN=YOUR_PROJECT_TOKEN
ERROR_STREAM_ENABLED=1

Finally, Add the errorstream config entries in your config/services.php

'errorstream' => [
    'api_token'     => env('ERROR_STREAM_API_TOKEN'),
    'project_token' => env('ERROR_STREAM_PROJECT_TOKEN'),
    'enabled'       => env('ERROR_STREAM_ENABLED'),
],

#Tagging Anywhere within your application you can append tags on to the reports that you generate and send to errorstream.com. Tags are great for grouping code together. You can make a call to add a tag anywhere by calling addTag(). A great place to do this would be to extend your Handler class modifications. For example:

public function report(Exception $e)
{
     if ($this->shouldReport($e)) {
          ErrorStream::addTag('v1.0.2');
          ErrorStream::reportException($e);
     }
     parent::report($e);
}

#Adding Context Sometimes you'll need additional information in order to diagnose issues. Context is great for adding more information to errors. Maybe you want to send a build number, user id, or anything else. You can use this in anywhere in your laravel application

ErrorStream::addContext('some more details about variables that are set');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固