Download the PHP package 1eonardo-dev/monitoring-client without Composer
On this page you can find all versions of the php package 1eonardo-dev/monitoring-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 1eonardo-dev/monitoring-client
More information about 1eonardo-dev/monitoring-client
Files in 1eonardo-dev/monitoring-client
Package monitoring-client
Short Description PHP client for reporting events (crash/exception/log) to Monitoring Platform.
License MIT
Informations about the package monitoring-client
Monitoring Platform Client
A lightweight PHP client for reporting events (crashes, exceptions, logs) to Monitoring Platform.
- No mandatory dependencies — runs in any PHP 7.4+ project.
- Never throws — a network failure is logged via
error_log()and the method returnsfalse, so your application never breaks while reporting. - Stream-based HTTP transport — no
curlrequired. - Optional framework adapters for Laravel and Yii2.
The Laravel/Yii2 adapter classes are only loaded if the corresponding framework is installed (lazy autoloading +
suggestincomposer.json), so they never break plain-PHP projects.
The two packages
This package targets modern PHP projects. If you still run PHP 5, use the legacy package instead:
| Package | PHP | Framework adapters | Type hints |
|---|---|---|---|
1eonardo-dev/monitoring-client |
7.4+ | Laravel & Yii2 | Yes |
1eonardo-dev/monitoring-client-legacy |
5.6+ | None (pure PHP) | No |
Requirements
- PHP 7.4 or later.
Installation
Quick start
API
MonitoringClient
| Method | Description |
|---|---|
captureException(\Throwable $e, array $context = [], ?string $level = null): bool |
Report an exception. |
captureMessage(string $message, string $level = 'info', array $context = []): bool |
Report a log message. |
captureEvent(Event $event): bool |
Report a custom event. |
send(array $data): bool |
Low-level send with a raw payload. |
DTOs
Event— value object for the event payload (type,level,message,platform,version,fingerprint,context).Config— groups the connection parameters (baseUrl,apiKey,platform,version,timeoutSeconds,path).
Custom endpoint path
By default events are sent to {baseUrl}/api/v1/events. You can change the
path via the path argument (or the path key in Config::fromArray):
Laravel integration
The package auto-discovers its service provider and facade. Optionally publish the config:
Add to your .env:
Then use the facade:
Yii2 integration
Custom transport
Implement LeonardoDev\Monitoring\Transport\Transport to use your own HTTP
client (Guzzle, cURL, etc.):
Tests
Changelog
See CHANGELOG.md.
License
MIT. See LICENSE.