Download the PHP package monkeyscloud/monkeyslegion-logger without Composer
On this page you can find all versions of the php package monkeyscloud/monkeyslegion-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monkeyscloud/monkeyslegion-logger
More information about monkeyscloud/monkeyslegion-logger
Files in monkeyscloud/monkeyslegion-logger
Package monkeyslegion-logger
Short Description High-performance, zero-dependency PSR-3 logger for MonkeysLegion with structured logging, handlers, processors, and PHP 8.4 features.
License MIT
Informations about the package monkeyslegion-logger
MonkeysLegion Logger v2
High-performance, zero-dependency PSR-3 logger for the MonkeysLegion PHP framework. Built natively in PHP 8.4 with no Monolog dependency.
Features
| Feature | Status |
|---|---|
| PSR-3 Compliant | ✅ Full Psr\Log\LoggerInterface |
| Zero External Dependencies | ✅ Only psr/log interface |
| 11 Handlers | Stream, Rotating, Syslog, ErrorLog, Console, Null, Buffer, FingersCrossed, Deduplication, Group, Sampling |
| 2 Formatters | Line (template), JSON (structured) |
| 6 Processors | UID, Memory, Introspection, Timestamp, Redact, Environment |
| PHP 8.4 Features | Property hooks, asymmetric visibility, backed enum, match expressions |
| Context Stacking | pushContext() / popContext() for scoped context |
| Log Metrics | Real-time per-level counters with $errorRate |
| Sensitive Data Redaction | Automatic GDPR/PCI-safe redaction |
| Probabilistic Sampling | Sample a % of debug logs in production |
| FingersCrossed (Black Box) | Buffer until error, then flush full context |
| Deduplication | Suppress repeated log entries |
Installation
Quick Start
Using the LogManager
Handlers
StreamHandler
Writes to files or PHP streams with LOCK_EX for concurrency safety.
RotatingFileHandler
Daily log rotation with automatic cleanup of old files.
ConsoleHandler
ANSI-colored output to stderr/stdout.
BufferHandler
Defers I/O by buffering records in memory. Flushes on close or overflow.
FingersCrossedHandler
Black box recorder. Buffers everything silently. When an error arrives, flushes the entire buffer — giving full debug context for production errors.
DeduplicationHandler
Suppresses repeated identical log entries within a time window.
SamplingHandler
Novel. Probabilistic sampling — logs only a percentage of non-error records.
GroupHandler
Dispatches to multiple handlers simultaneously.
Processors
RedactProcessor (Novel)
Automatically redacts sensitive fields from context data.
Other Processors
Context Stacking
Log Metrics
LogLevel Enum
Changelog
2.0.0 — Complete Rebuild
BREAKING CHANGE: Full API redesign. All v1 classes removed.
- Architecture: Replaced Monolog-dependent design with native, zero-dependency Handler/Formatter/Processor architecture
- Core Types:
LogLevelbacked enum, immutableLogRecordVO,LogMetricsVO - 13 Handlers: Stream, RotatingFile, Syslog, ErrorLog, Console, Null, Buffer, FingersCrossed, Deduplication, Group, Sampling
- 2 Formatters: LineFormatter (template-based), JsonFormatter (structured JSON Lines)
- 7 Processors: UID, Memory, Introspection, Timestamp, Redact, Environment
- Novel Features: Probabilistic sampling, sensitive data redaction, context stacking, real-time log metrics
- PHP 8.4: Property hooks, asymmetric visibility, backed enums, match expressions
- DI-First:
LogManagerwith config-driven channel resolution and custom driver extension - Tests: 96 tests, 171 assertions
Requirements
- PHP 8.4+
psr/log^3.0
License
MIT