PHP code example of lunatic / monolog-bunyan-formatter

1. Go to this page and download the library: Download lunatic/monolog-bunyan-formatter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lunatic / monolog-bunyan-formatter example snippets


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'));