krak / psr-log-util
PSR Logging Utilities
v0.1.0
2019-03-15 00:38 UTC
Requires
- psr/log: ^1.1
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-10-15 12:50:23 UTC
README
This library contains a set of utilities and decorators for PSR-3 Compatible loggers.
Installation
Install with composer at krak/psr-log-util
Usage
TemplateLogger
The TemplateLogger is a decorator that allows you to wrap a template around your log messages.
<?php use Krak\PsrLogUtil\TemplateLogger; $logger = new SomePsr3Logger(); $logger = new TemplateLogger('Acme: %s', $logger); $logger->info("Hi"); // should output something like: Acme: Hi
This can be very useful for prefixing certian logs to make them easier to search later on.