定制 penobit/crash-reporter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

penobit/crash-reporter

最新稳定版本:v0.4.1

Composer 安装命令:

composer require penobit/crash-reporter

包简介

Penobit's Crash Reporter will notify crash reports via email and HTTP requests to your api.

README 文档

README

Laravel crash reporter library will notify you about any uncaught exceptions in your laravel application by Sending you an email or making a POST/GET HTTP request to an endpoint

Installation

You can install Laravel Crash Reporter package simply using the Composer Just execute following command:

php composer require penobit/crash-reporter

after compoer downloaded and installed the package you should publish it's config file, To do that run following cmd

php artisan vendor:publish --tag config

This cmd will publish a new file crash-reporter.php to your app/config directory

Configuration

Laravel crash reporter is completely configurable. it's configurable using .env file or directly from crash-reporter.php file. The .env file is our recommended way yo configure the crash reporter

Configuration Environment File .env Config file crash-reporter.php Default Value
Is Crash Reporter Enabled CRASH_REPORTER_ENABLED enabled false
Send Exceptions Over Email Channel CRASH_REPORTER_EMAIL_CHANNEL channels.email true
Crash Sender EMail Address CRASH_REPORTER_FROM_EMAIL email.from.address MAIL_FROM_ADDRESS in .env
Crash Sender Email's Sender Name CRASH_REPORTER_FROM_NAME email.from.address MAIL_FROM_NAME in .env if available "Laravel Crash Reporter" otherwise
Send crash reports toSupports multiple addresses seperated by ; CRASH_REPORTER_EMAIL_ADDRESS email.to null
Send Exceptions Over HTTP Channel CRASH_REPORTER_HTTP_CHANNEL channels.http false
Http request method CRASH_REPORTER_HTTP_METHOD http.method "POST"
Send HTTP request to CRASH_REPORTER_HTTP_ENDPOINT http.endpoint null
HTTP Request Token *1 CRASH_REPORTER_HTTP_TOKEN http.token null

*1 Please Note! The token will be sent in two different ways based on HTTP request method:

  • GET: the token will be added to the url's query string like: api.penobit.com/report/crash?token=MY_TOKEN_FROM_ENV_FILE
  • POST: the token will be sent as an authorization bearer header: Authorization: Bearer MY_TOKEN_FROM_ENV_FILE

Customizations

You can customize the email template by creating a new template in your views directory. just create your custom email template template in this path: /resources/views/vendor/penobit/crash-reporter/crash-reporter-mail.blade.php and the crash reporter uses that instead of the default email template. You can also use these $data variable that is an object containing the exceptions details:

  • $data->message: Exception message
  • $data->file: File where exception was thrown
  • $data->line: Line where exception was thrown
  • $data->trace: Exception trace
  • $data->url: URL where exception was thrown
  • $data->body: Request body
  • $data->ip: IP address of the user
  • $data->method: Request method
  • $data->userAgent: Users's User agent
  • $data->browser: User's browser name
  • $data->browser_logo: User's browser logo base64 encoded URI
  • $data->os: User's OS name
  • $data->os_logo: User's OS logo base64 encoded URI

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-07-23