sailantis / azera-log
Logging companion for the Azera framework: Monolog-based logging with Azera-specific extensions (composite file rotation, console coloring) and ready-made PSR-14 listeners for database, auth, and queue events.
v0.4.2
2026-11-16 00:04 UTC
Requires
- php: >=8.2
- monolog/monolog: ^3.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
- sailantis/azera-framework: ^0.4.1 || dev-main
Requires (Dev)
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Logging companion for the Azera framework.
The framework ships only a NullLogger (PSR-3). This package builds on
Monolog (the de-facto standard PSR-3
logger) and adds only the pieces Monolog does not provide:
Handler\RollingFileHandler— log4j-style composite (size + date), size, and date rotation. Monolog'sRotatingFileHandleris date-only, so this covers the missing size/composite rotation.Formatter\ConsoleFormatter+Processor\AnsiColorProcessor— selective per-level ANSI coloring for CLI output (only the level segment is colored), without a Symfony Console dependency.- Listeners (PSR-14):
DbQueryLogger(all DB events),SlowQueryHandler(threshold-filteredQueryExecuted),TransactionAuditListener,AuthLoggerListener,QueueWorkerListener.
Everything else — the Logger, standard handlers, formatters, and processors —
comes from Monolog directly. Use Monolog\Logger and push the Azera extensions
onto it as you would any Monolog handler/processor.
Example
use Azera\Log\Formatter\ConsoleFormatter; use Azera\Log\Handler\RollingFileHandler; use Azera\Log\Processor\AnsiColorProcessor; use Monolog\Logger; $logger = new Logger('app'); $handler = new RollingFileHandler( '/var/log/app.log', options: ['rollingMode' => 'composite', 'maxFileSize' => 10485760], ); $handler->setFormatter(new ConsoleFormatter()); $logger->pushHandler($handler); $logger->pushProcessor(new AnsiColorProcessor());
Installation
composer require sailantis/azera-log
License
MIT.