定制 bughq/bughq-laravel 二次开发

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

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

bughq/bughq-laravel

Composer 安装命令:

composer require bughq/bughq-laravel

包简介

bughq error tracking - Laravel integration

README 文档

README

Privacy-first error tracking for Laravel apps, backed by bughq/bughq and bughq.

Out of the box:

  • Reported exceptions are captured through Laravel's exception handler (after your dontReport filtering), with route, request, and authenticated-user context attached.
  • Failed queue jobs are captured with job name, queue, connection, and attempt count.
  • SQL queries and log messages are recorded as breadcrumbs, so every event arrives with the trail that led to it.
  • A bughq log channel turns Log::channel('bughq')->error(...) (or a stack channel) into bughq events.

Install

Requires PHP 8.4+ and Laravel 11 or 12.

composer require bughq/bughq-laravel

Until the packages are on Packagist, add the VCS repositories first:

composer config repositories.bughq-php vcs https://github.com/bughq/bughq-php
composer config repositories.bughq-laravel vcs https://github.com/bughq/bughq-laravel

The service provider and BugHQ facade are auto-discovered.

Configure

php artisan vendor:publish --tag=bughq-config
BUGHQ_PROJECT=acme-api
BUGHQ_KEY=pk_...
# or a single DSN:
# BUGHQ_DSN=https://pk_...@bughq.org/acme-api

environment defaults to the app environment; set BUGHQ_RELEASE to tag deploys. See config/bughq.php for breadcrumb/capture toggles, sample_rate, and ignore_exceptions.

Manual capture

use BugHQ\Laravel\Facades\BugHQ;

BugHQ::captureException($e, ['orderId' => $order->id]);
BugHQ::captureMessage('imports finished', 'info');
BugHQ::setTag('tenant', $tenant->slug);
BugHQ::setContext('order', ['id' => $order->id, 'total' => $order->total]);
BugHQ::addBreadcrumb(['category' => 'payment', 'message' => 'charge submitted']);

Log channel

// config/logging.php
'channels' => [
    'bughq' => ['driver' => 'bughq', 'level' => 'error'],

    // or fan out alongside your existing channel:
    'stack' => ['driver' => 'stack', 'channels' => ['single', 'bughq']],
],

Log records carrying an exception in context are captured with their full stack trace.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固