PHPackages                             jardisadapter/logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jardisadapter/logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jardisadapter/logger
====================

PSR-3 logging pipeline with 20+ handlers, 7 formatters, 6 enrichers, and fluent builder API

v1.0.0(2mo ago)0761proprietaryPHPPHP &gt;=8.2CI passing

Since Mar 18Pushed 2mo agoCompare

[ Source](https://github.com/jardisAdapter/logger)[ Packagist](https://packagist.org/packages/jardisadapter/logger)[ Docs](https://github.com/jardisAdapter/logger)[ RSS](/packages/jardisadapter-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (5)Used By (1)

Jardis Logger
=============

[](#jardis-logger)

[![Build Status](https://github.com/jardisAdapter/logger/actions/workflows/ci.yml/badge.svg)](https://github.com/jardisAdapter/logger/actions/workflows/ci.yml/badge.svg)[![License: PolyForm Shield](https://camo.githubusercontent.com/d8fb46c82be4c5312bf3e372ac734dfdf6a8b328e9c2b2856af671adbb0600a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d506f6c79466f726d253230536869656c642d626c75652e737667)](LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/a68b290dcc313d698dc138a1111aa83eee2f143605449d7e8b5416ea6f88558f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e322d3737374242342e737667)](https://www.php.net/)[![PHPStan Level](https://camo.githubusercontent.com/c51bda247654363d3e30bc352674dd761a9557803a14af0226eb411d6dc0006b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e737667)](phpstan.neon)[![PSR-12](https://camo.githubusercontent.com/34b10db0caa29bacd49bda5c437a8de95385f036f3230b31fa605326e18da22c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f64652532305374796c652d5053522d2d31322d626c75652e737667)](phpcs.xml)[![PSR-3](https://camo.githubusercontent.com/76db838885931d8f63a37cc20c6d033675f31ac75a81dc9329d8289c8f1b042a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6f676765722d5053522d2d332d627269676874677265656e2e737667)](https://www.php-fig.org/psr/psr-3/)[![Coverage](https://camo.githubusercontent.com/446ee39531b16023361c043d89f79da09052da7f34c87c2366080ef599f6c83b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d38352e32342532352d677265656e2e737667)](https://github.com/jardisAdapter/logger)

> Part of the **[Jardis Business Platform](https://jardis.io)** — Enterprise-grade PHP components for Domain-Driven Design

PSR-3 logging pipeline with 20+ handlers, 7 formatters, and 6 enrichers. Configure everything through a fluent `LoggerBuilder` — the resulting `Logger` is immutable after construction. Smart handlers for production: `LogFingersCrossed` buffers until an error occurs, `LogSampling` reduces noise at high volume, `LogConditional` routes by content. One `LoggerBuilder` context per bounded context keeps logs cleanly separated.

---

Features
--------

[](#features)

- **20+ Handlers** — File, Console, Slack, Teams, Redis, Kafka, RabbitMQ, Loki, Database, Email, Webhook, Syslog, and more
- **Smart Handlers** — `LogFingersCrossed` (buffer-on-error), `LogSampling` (volume reduction), `LogConditional` (rule-based routing)
- **Fluent Builder** — `LoggerBuilder` chains handler registration; `getLogger()` returns an immutable `Logger`
- **Auto-Enrichment** — `LogDateTime`, `LogUuid`, `LogMemoryUsage`, `LogMemoryPeak`, `LogClientIp`, `LogWebRequest` added per handler
- **7 Formatters** — `LogJsonFormat`, `LogLineFormat`, `LogHumanFormat`, `LogSlackFormat`, `LogTeamsFormat`, `LogLokiFormat`, `LogBrowserConsoleFormat`
- **Named Handlers** — Retrieve any handler at runtime via `$logger->getHandler('name')`
- **Error Resilience** — One failing handler never stops the others; optional error callback via `setErrorHandler()`
- **Context Separation** — Each `LoggerBuilder` instance scopes its handlers to a named bounded context

---

Installation
------------

[](#installation)

```
composer require jardisadapter/logger
```

Quick Start
-----------

[](#quick-start)

```
use JardisAdapter\Logger\LoggerBuilder;
use Psr\Log\LogLevel;

// Console + file in two lines
$logger = (new LoggerBuilder('OrderService'))
    ->addConsole(LogLevel::DEBUG)
    ->addFile(LogLevel::INFO, '/var/log/orders.log')
    ->getLogger();

$logger->info('Order created', ['order_id' => 4711]);
$logger->error('Payment failed', ['order_id' => 4711, 'reason' => 'Card declined']);
```

Advanced Usage
--------------

[](#advanced-usage)

```
use JardisAdapter\Logger\LoggerBuilder;
use JardisAdapter\Logger\Handler\LogFile;
use Psr\Log\LogLevel;

// Production setup: file baseline + Slack alerts + FingersCrossed buffer + Sampling
$fileHandler = new LogFile(LogLevel::DEBUG, '/var/log/app.log');

$logger = (new LoggerBuilder('PaymentService'))
    // Always write DEBUG and above to file
    ->addHandler($fileHandler)

    // Alert on Slack for CRITICAL and above
    ->addSlack(
        logLevel: LogLevel::CRITICAL,
        webhookUrl: 'https://hooks.slack.com/services/...',
        name: 'slack-alerts'
    )

    // Buffer all messages; flush everything to file only when ERROR is triggered
    ->addFingersCrossed(
        wrappedHandler: $fileHandler,
        activationLevel: LogLevel::ERROR,
        bufferSize: 200,
        name: 'fingers-crossed'
    )

    // Reduce INFO noise to 10 % under load
    ->addSampling(
        wrappedHandler: $fileHandler,
        strategy: 'rate',
        config: ['rate' => 10],
        name: 'sampler'
    )

    ->getLogger();

$logger->info('Checkout started', ['session' => 'abc123']);
$logger->error('Stripe timeout', ['attempt' => 3]);

// Retrieve a named handler at runtime
$slackHandler = $logger->getHandler('slack-alerts');
```

Documentation
-------------

[](#documentation)

Full documentation, guides, and API reference:

**[jardis.io/docs/adapter/logger](https://jardis.io/docs/adapter/logger)**

License
-------

[](#license)

This package is licensed under the [PolyForm Shield License 1.0.0](LICENSE.md). Free for all use except building competing frameworks or developer tooling.

---

**[Jardis](https://jardis.io)** · [Documentation](https://jardis.io/docs) · [Headgent](https://headgent.com)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

62d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e07a1b668e9e01ee6d1b85de7b3be1c2513f68aae9494b2011d1592104d5daa0?d=identicon)[jardis](/maintainers/jardis)

---

Top Contributors

[![Headgent](https://avatars.githubusercontent.com/u/245725954?v=4)](https://github.com/Headgent "Headgent (1 commits)")

---

Tags

psr-3loggingloggerDomain Driven Designdddlog formatterjardis

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jardisadapter-logger/health.svg)

```
[![Health](https://phpackages.com/badges/jardisadapter-logger/health.svg)](https://phpackages.com/packages/jardisadapter-logger)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
