tyamahori / monolog-ltsv-formatter
LTSV Formatter for Monolog
Installs: 1 009
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- monolog/monolog: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.14
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.0|^10.0
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-11-20 06:13:23 UTC
README
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