loginformant / monolog-handler
Monolog handler for LogInformant — centralized log management.
Package info
github.com/Sergey-PrudentDev/loginformant-monolog
pkg:composer/loginformant/monolog-handler
v1.0.0
2026-04-22 03:47 UTC
Requires
- php: >=8.0
- ext-curl: *
- monolog/monolog: ^3.0
This package is not auto-updated.
Last update: 2026-07-02 02:54:30 UTC
README
Send logs to LogInformant from PHP using Monolog v3.
Install
composer require loginformant/monolog-handler
Quick Start
<?php use Monolog\Logger; use LogInformant\LogInformantHandler; $log = new Logger('myapp'); $log->pushHandler(new LogInformantHandler( apiUrl: 'https://app.loginformant.com', apiKey: 'YOUR-API-KEY-HERE', )); $log->info('User logged in', ['user_id' => 42]); $log->warning('Slow query', ['query_ms' => 1200]); $log->error('Payment failed', ['order_id' => 99, 'exception' => $e]);
Laravel
In config/logging.php:
'channels' => [ 'loginformant' => [ 'driver' => 'monolog', 'handler' => \LogInformant\LogInformantHandler::class, 'with' => [ 'apiUrl' => env('LOGINFORMANT_URL', 'https://app.loginformant.com'), 'apiKey' => env('LOGINFORMANT_KEY'), ], ], ],
In .env:
LOGINFORMANT_KEY=YOUR-API-KEY-HERE
Set the default channel: LOG_CHANNEL=loginformant
Symfony
In config/packages/monolog.yaml:
monolog: handlers: loginformant: type: service id: LogInformant\LogInformantHandler
In services.yaml:
LogInformant\LogInformantHandler: arguments: $apiUrl: 'https://app.loginformant.com' $apiKey: '%env(LOGINFORMANT_KEY)%'
Options
| Parameter | Default | Description |
|---|---|---|
apiUrl |
— | Your LogInformant API base URL |
apiKey |
— | API key from your application settings |
batchSize |
50 | Flush after this many records |
level |
DEBUG | Minimum Monolog level to handle |
Log Level Mapping
| Monolog | LogInformant |
|---|---|
| DEBUG | Debug |
| INFO | Information |
| NOTICE | Information |
| WARNING | Warning |
| ERROR | Error |
| CRITICAL | Fatal |
| ALERT | Fatal |
| EMERGENCY | Fatal |