rustem-kaimolla/laravel-exception-reporter
Composer 安装命令:
composer require rustem-kaimolla/laravel-exception-reporter
包简介
Laravel package to report exceptions via TCP
README 文档
README
LLM exception analysis and automatic creation of incident as bug in Jira
A simple exception reporting agent for Laravel applications that sends exceptions to a remote Exception Reporter Agent service https://github.com/rustem-kaimolla/exception-reporter-agent.
Installation
Install via Composer:
composer require rustem-kaimolla/laravel-exception-reporter
Publish the config file:
php artisan vendor:publish --tag=exception-reporter-config
Configuration
After publishing, configure the following values in your .env file:
EXCEPTION_REPORTER_ENABLED=true EXCEPTION_TCP_HOST=127.0.0.1 EXCEPTION_TCP_PORT=9000
Or configure directly in config/exception-reporter.php:
return [ 'enabled' => env('EXCEPTION_REPORTER_ENABLED', true), 'endpoint' => env('EXCEPTION_REPORTER_ENDPOINT'), 'token' => env('EXCEPTION_REPORTER_TOKEN'), ];
Usage
To report exceptions to the agent, you must manually call the reporter in your App\Exceptions\Handler:
use Throwable; use ExceptionReporter; public function report(Throwable $exception) { ExceptionReporter::report($exception); // Send exception to the agent parent::report($exception); // Continue Laravel's default reporting }
Advanced Integration (Optional)
If you want automatic reporting without modifying your exception handler, you can:
- Create a custom
ExceptionHandlerand bind it in the service container:
app()->singleton( \Illuminate\Contracts\Debug\ExceptionHandler::class, \App\Exceptions\CustomHandler::class );
- Subscribe to Laravel's internal exception events:
use Illuminate\Foundation\Exceptions\Events\ExceptionOccurred; use Illuminate\Support\Facades\Event; use ExceptionReporter; Event::listen(ExceptionOccurred::class, function ($event) { ExceptionReporter::report($event->exception); });
Note: For production use, it's recommended to use the manual
report()override for more control.
License
MIT License. See LICENSE for more details.
Contributions
Pull requests are welcome. Please open issues for feature suggestions or bugs.
Made with ❤️ for Laravel developers who hate debugging twice.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-05
