PSR-3 Logger for PHP 8.2+ - Simple Start, Enterprise Scale, Domain-Driven Design

Installs: 71

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/jardisadapter/logger

v1.0.0 2026-02-25 17:36 UTC

README

Build Status License: PolyForm NC PHP Version PHPStan Level PSR-3 PSR-4 PSR-12 Coverage

Part of the Jardis Ecosystem - A modular DDD framework for PHP

A powerful PSR-3 compliant logging library for PHP 8.2+. Unlike traditional loggers, Jardis Logger provides a fluent interface with 20+ handlers, smart handlers for production (FingersCrossed, Sampling, Conditional), and built-in support for Domain-Driven Design with context-based logging per bounded context.

Features

  • 20+ Handlers - File, Console, Slack, Teams, Kafka, RabbitMQ, Redis, Loki, Database, Email, Webhook and more
  • Smart Handlers - FingersCrossed (buffering), Sampling (volume reduction), Conditional (routing)
  • Fluent Interface - Chain handlers with IDE autocomplete, no config files needed
  • Auto-Enrichment - Timestamps, UUIDs, Memory, IPs automatically added to every log
  • Multiple Formats - JSON, Human-Readable, Loki, Slack, Teams, ChromeLogger
  • Named Handlers - Dynamic handler management at runtime
  • Error Resilience - One handler fails? Others continue processing
  • DDD Ready - One logger per bounded context for clean separation

Installation

composer require jardisadapter/logger

Quick Start

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

// One line. Done.
$logger = (new Logger('MyApp'))->addConsole(LogLevel::INFO);
$logger->info('Hello World');

// Chain multiple handlers
$logger = (new Logger('OrderService'))
    ->addConsole(LogLevel::DEBUG)
    ->addFile(LogLevel::INFO, '/var/log/app.log')
    ->addSlack(LogLevel::ERROR, 'https://hooks.slack.com/...');

$logger->info('Order created', ['order_id' => 12345]);

Documentation

Full documentation, examples and API reference:

-> jardis.io/docs/adapter/logger

Jardis Ecosystem

This package is part of the Jardis Ecosystem - a collection of modular, high-quality PHP packages designed for Domain-Driven Design.

Category Packages
Core Domain, Kernel, Data, Workflow
Adapter Cache, Logger, Messaging, DbConnection
Support DotEnv, DbQuery, Validation, Factory, ClassVersion
Tools Builder, DbSchema

-> Explore all packages

License

This package is licensed under the PolyForm Noncommercial License 1.0.0.

For commercial use, see COMMERCIAL.md.

Jardis Ecosystem by Headgent Development