logger / essentials
Advanced logging component library
Installs: 57 464
Dependents: 5
Suggesters: 4
Security: 0
Stars: 6
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/logger/essentials
Requires (Dev)
- phpstan/phpstan: >= 0.1
- phpunit/phpunit: >= 5.0
- rector/rector: ^2.2
Suggests
- logger/chrome: Logger for the chrome-logger plugin
- logger/loggly: Logger api to loggly.com
- logger/newrelic: Logger for NewRelic
- logger/pushover: Logger api to pushover.net
- logger/rollbar: Logger api to rollbar.com
Provides
- psr/log-implementation: 1.0.0
This package is auto-updated.
Last update: 2025-11-23 21:42:07 UTC
README
A lightweight, composable logging toolkit for PHP that implements the PSR‑3 LoggerInterface and lets you build flexible pipelines. Combine output loggers (e.g., streams, syslog) with formatters, filters, and extenders to shape messages, enrich context, and route by severity. Includes an ExtendedLogger for hierarchical captions and execution scopes.
Quick taste
use Logger\Builder; use Logger\Formatters\TemplateFormatter; use Logger\Loggers\ResourceLogger; use Psr\Log\LoggerInterface; $logger = Builder::chain( ResourceLogger::outputToStdOut(), fn (LoggerInterface $l) => new TemplateFormatter($l) ); $logger->info('Hello world', ['id' => 42]);
Component overview
- Common — ExtendedLogger for hierarchical captions and contextual scopes.
- Formatters — Render and transform messages (Template, DateTime, Prefix, JSON, etc.).
- Filters — Pass/drop by rules (min/max/range level, callbacks, regex).
- Loggers — Output sinks: streams, syslog, callbacks, in‑memory array.
- Extenders — Side‑effect hooks and enrichment (context, stacktrace, metrics).
- Manipulators — Adjust semantics like compressing log levels.
How it differs from other logging solutions: