impactlabs/laravel-error-tracker
Composer 安装命令:
composer require impactlabs/laravel-error-tracker
包简介
Track errors by their business impact - know which bugs cost you money. Lightweight alternative to Sentry/Flare.
关键字:
README 文档
README
A Laravel package that tracks not just errors, but their business impact. Perfect for SaaS, AdTech, and e-commerce platforms where errors have measurable financial consequences.
🎯 What Makes This Different
Unlike traditional error trackers, this package answers:
- "Which errors are costing us money?"
- "Which customers are affected?"
- "Should we fix this NOW or later?"
✨ Features
- 🎯 Business Impact Tracking - Track revenue loss, affected customers, and business metrics
- 🔥 Smart Priority Scoring - Automatically prioritize errors by business impact
- 📊 Context Enrichment - Capture business entities, user context, and system state
- 🔔 Intelligent Notifications - WhatsApp, Slack, Email with actionable insights
- 📡 Flexible Forwarding - Send logs to Elasticsearch, Graylog, Sentry, Datadog, etc.
- ⚡ Lightweight & Fast - <500KB memory, 3-6ms execution (async mode)
- 🎨 Simple Usage - One-line trait implementation
📦 Installation
composer require impactlabs/laravel-error-tracker
Publish the config and migrations:
php artisan vendor:publish --tag=error-tracker php artisan migrate
🚀 Quick Start
Option 1: Using Traits (Recommended)
use ImpactLabs\ErrorTracker\Traits\TracksBusinessErrors; class Campaign extends Model { use TracksBusinessErrors; public function process() { try { // Your business logic } catch (\Exception $e) { // One line - auto-detects context! $this->reportError($e); throw $e; } } }
Option 2: Manual Reporting
use ImpactLabs\ErrorTracker\Facades\ErrorTracker; ErrorTracker::report($exception) ->withAdvertiser($advertiserId) ->withCampaign($campaignId) ->withRevenueImpact(5000.00) ->withUserTier('premium') ->send();
Option 3: Global Handler
// In app/Exceptions/Handler.php public function register() { $this->reportable(function (\Throwable $e) { \ImpactLabs\ErrorTracker\Facades\ErrorTracker::report($e)->send(); }); }
⚙️ Configuration
Configure in .env:
# Enable tracking ERROR_TRACKER_ENABLED=true ERROR_TRACKER_ASYNC=true # Elasticsearch forwarding ES_ERROR_TRACKER_ENABLED=true ES_ERROR_TRACKER_HOST=http://localhost:9200 # WhatsApp notifications WHATSAPP_ERROR_ENABLED=true WHATSAPP_API_URL=your-whatsapp-api-url WHATSAPP_ERROR_PHONE=8801234567890 WHATSAPP_ACCESS_TOKEN=your-token # Slack notifications SLACK_ERROR_ENABLED=true SLACK_ERROR_WEBHOOK=your-slack-webhook
📊 View Top Errors
# Show top errors by priority php artisan error-tracker:top # Show by revenue impact php artisan error-tracker:top --by=revenue # Show for specific advertiser php artisan error-tracker:top --advertiser=123
🔌 Supported Log Forwarders
Self-hosted
- ✅ Elasticsearch
- ✅ Graylog
- ✅ Grafana Loki
Managed Services
- ✅ Sentry
- ✅ Datadog
- ✅ Logtail (Better Stack)
Custom
- ✅ Any HTTP endpoint
🧪 Testing
composer test
📝 Changelog
Please see CHANGELOG for more information on what has changed recently.
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email selimppc@gmail.com instead of using the issue tracker.
💖 Credits
- Selim Reza - Creator & Maintainer
- All Contributors
📄 License
The MIT License (MIT). Please see License File for more information.
impactlabs/laravel-error-tracker 适用场景与选型建议
impactlabs/laravel-error-tracker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「monitoring」 「laravel」 「saas」 「error-tracking」 「adtech」 「business-metrics」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 impactlabs/laravel-error-tracker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 impactlabs/laravel-error-tracker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 impactlabs/laravel-error-tracker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony bundle for chameleon-system/sanitycheck
SoftWax Health Check Bundle for Symfony framework
1Pilot client for Symfony
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.
Statsd (Object Oriented) client library for PHP
APM agent for laravel projects to monitor the application with elastic apm tools.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 42
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-29