tyamahori/monolog-ltsv-formatter

LTSV Formatter for Monolog

v1.0.1 2023-02-20 02:26 UTC

This package is auto-updated.

Last update: 2024-11-20 06:13:23 UTC


README

A LTSV Formatter for Monolog

This is a fork project of https://github.com/fjyuu/monolog-ltsv-formatter

Usage

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Tyamahori\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

Requirement

  • PHP8.1 or later
  • Monolog v3 or higher

Installation

composer require tyamahori/monolog-ltsv-formatter