/monolog-bunyan-formatter

Make monolog produce bunyan style output

Primary LanguagePHPMIT LicenseMIT

Bunyan Formatter for Monolog Build Status

About

The Bunyan formatter was ported from the Punyan project to support projects which already started with Monolog

Requirements

  • = PHP 5.3

  • Composer

Installation

composer require lunatic/monolog-bunyan-formatter

Usage

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Lunatic666\Monolog\Formatter\BunyanFormatter;

$log = new Logger('demo');
$handler = new StreamHandler('php://stdout', Logger::INFO);
$handler->setFormatter(new BunyanFormatter());
$log->pushHandler($handler);

$log->info('Hello, Mr. Bunyan', array('link' => 'https://en.wikipedia.org/wiki/Paul_Bunyan'));