hikaeme / monolog-ltsv-formatter
LTSV Formatter for Monolog
Installs: 596 086
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- monolog/monolog: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2024-10-16 05:45:30 UTC
README
Usage
use Monolog\Level; use Monolog\Logger; use Monolog\Handler\StreamHandler; use Hikaeme\Monolog\Formatter\LtsvFormatter; $log = new Logger('DEMO'); $handler = new StreamHandler('php://stdout', Level::Error); $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