PSR-3 compliant logger

0.1.0 2017-08-08 14:38 UTC

This package is not auto-updated.

Last update: 2021-05-01 10:08:35 UTC


Simple PSR-3 compliant logger with custom writers and formatters support

Usage example

use \iotch\Log;

// create logger
$logger = new Log\Manager('myLogger', new DateTimeZone('Europe/Minsk'));

// open stream to write logs to
$stream = fopen('php://memory', 'a');

// configure writer
$writer = new Log\Writer\StreamWriter($stream);
    ->setFormatter(new Log\Formatter\DefaultFormatter)

// register writer

// add to log
$logger->emergency('Emergency message');
$logger->log($logger::INFO, 'Info message');

print_r(stream_get_contents($stream, -1, 0));