PHP code example of tatocaster / monolog-json-unicode-pretty-formatter

1. Go to this page and download the library: Download tatocaster/monolog-json-unicode-pretty-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/ */

    

tatocaster / monolog-json-unicode-pretty-formatter example snippets


use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Tatocaster\Monolog\Formatter\JsonPrettyUnicodePrintFormatter;

$logger = new Logger('MyLogger');
$handler = new StreamHandler('/var/log/mylogger.log', Logger::INFO);
$handler->setFormatter(new JsonPrettyUnicodePrintFormatter());
$logger->pushHandler($handler);