hikaeme/monolog-ltsv-formatter

LTSV Formatter for Monolog

2.0.0 2019-11-16 15:04 UTC

This package is auto-updated.

Last update: 2021-04-16 18:29:40 UTC


README

Build Status StyleCI Latest Stable Version Total Downloads Latest Unstable Version License

A LTSV Formatter for Monolog

Usage

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Hikaeme\Monolog\Formatter\LtsvFormatter;

$log = new Logger('DEMO');
$handler = new StreamHandler('php://stdout', Logger::WARNING);
$handler->setFormatter(new LtsvFormatter('Y-m-d H:i:s'));
$log->pushHandler($handler);

$log->error('Something happened', ['detail1' => 'foo', 'detail2' => 'bar']);
// time:2016-01-02 11:58:03<tab>level:ERROR<tab>message:Something happened<tab>detail1:foo<tab>detail2:bar

Installation

composer require hikaeme/monolog-ltsv-formatter