krak/psr-log-util

PSR Logging Utilities

v0.1.0 2019-03-15 00:38 UTC

This package is auto-updated.

Last update: 2020-10-15 04:18:41 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.