error-tag/errortag-laravel
Composer 安装命令:
composer require error-tag/errortag-laravel
包简介
ErrorTag is an error monitoring and observability platform. This package is the client SDK that captures errors from your Laravel application and sends them to the ErrorTag dashboard for analysis, alerting, and team collaboration.
关键字:
README 文档
README
ErrorTag is an error monitoring and observability platform. This package is the client SDK that captures errors from your Laravel application and sends them to the ErrorTag dashboard for analysis, alerting, and team collaboration.
Requirements
- PHP: 8.1 or higher
- Laravel: 10.x, 11.x, or 12.x
- HTTP Client: Guzzle (included with Laravel)
Features
- Automatic Error Capture - Hooks into Laravel's exception handler
- Intelligent Error Grouping - Groups similar errors using fingerprints
- Privacy-First - Sanitizes sensitive data (passwords, tokens, headers)
- Works Everywhere - Sync mode (no queue required) or async via queue
- Rich Context - Captures request, user, and application data
- Circuit Breaker - Prevents infinite loops and server overload
- Highly Configurable - Sample rates, ignored exceptions, and more
- Fully Tested - Comprehensive test coverage with Pest
Installation
Install the package via Composer:
composer require error-tag/errortag-laravel
Publish the configuration file:
php artisan vendor:publish --tag="errortag-laravel-config"
Add your ErrorTag API key to .env:
ERRORTAG_KEY=project_xxxxx ERRORTAG_ENV=production
Quick Start
Once installed, ErrorTag automatically captures all unhandled exceptions.
By default, errors are sent synchronously (no queue worker required). This works perfectly on shared hosting, local development, and production.
Test your setup:
php artisan errortag:test --send-test-error
Queue Configuration (Optional)
For high-traffic applications, you can enable async sending via queue:
ERRORTAG_USE_QUEUE=true ERRORTAG_QUEUE_CONNECTION=database
Important: Only enable queues if you have workers running via cron or supervisor.
For shared hosting with cron: Add this to your crontab:
* * * * * php /path/to/artisan queue:work --stop-when-empty --tries=2 --max-time=50
Usage
Automatic Capture
// This exception is automatically captured throw new Exception('Something went wrong!');
Manual Reporting
use ErrorTag\ErrorTag\Facades\ErrorTag; try { processPayment($order); } catch (Exception $e) { ErrorTag::captureException($e); }
Adding Context
ErrorTag::context([ 'order_id' => $order->id, 'payment_provider' => 'stripe', ]);
Configuration
Laravel Version Compatibility
Laravel 11+ and 12+
ErrorTag automatically registers via its service provider. You can also manually configure exception reporting in bootstrap/app.php:
->withExceptions(function (Exceptions $exceptions): void { // ErrorTag is auto-registered, but you can customize here if needed })->create();
Laravel 10 and below
ErrorTag automatically registers via its service provider using the reportable() method. No manual configuration needed. Just install the package and configure your .env file.
Sync vs Async Sending
Sync Mode (Default - Recommended)
ERRORTAG_USE_QUEUE=false ERRORTAG_SYNC_TIMEOUT=2 # Fast timeout to avoid blocking requests
- Works immediately after installation
- No queue worker required
- Perfect for shared hosting
- Great for low-medium traffic
Async Mode (Queue)
ERRORTAG_USE_QUEUE=true ERRORTAG_QUEUE_CONNECTION=database ERRORTAG_TIMEOUT=5
- Better for high-traffic apps
- Doesn't block user requests
- Requires queue worker running
Other Options
# Disable ErrorTag in local environment ERRORTAG_ENABLED=true # Sample rate (capture 50% of errors) ERRORTAG_SAMPLE_RATE=0.5 # Don't capture request body (privacy) ERRORTAG_CAPTURE_BODY=false # Circuit breaker (stop after 5 failures) ERRORTAG_CIRCUIT_BREAKER_THRESHOLD=5
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
error-tag/errortag-laravel 适用场景与选型建议
error-tag/errortag-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 110 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「error handling」 「laravel」 「error monitoring」 「Error-Tag」 「errortag-laravel」 「Error Observability」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 error-tag/errortag-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 error-tag/errortag-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 error-tag/errortag-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides form handler for Symfony form types
PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient
Common classes for handling files
Error and Exception override and observers.
Error handler based on Booboo with HTML and JSON support
Error Share App, for handle error page
统计信息
- 总下载量: 110
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-06