loginformant/monolog-handler

Monolog handler for LogInformant — centralized log management.

Maintainers

Package info

github.com/Sergey-PrudentDev/loginformant-monolog

Homepage

pkg:composer/loginformant/monolog-handler

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-04-22 03:47 UTC

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