PHP code example of proemergotech / prmrgt-monolog-formatter

1. Go to this page and download the library: Download proemergotech/prmrgt-monolog-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/ */

    

proemergotech / prmrgt-monolog-formatter example snippets


$handler = new Monolog\Handler\StreamHandler(env('LOG_STREAM', '/tmp/stdout.sock'), \Monolog\Logger::DEBUG);
$handler->setFormatter(new PrmrgtLogFormatter(['keyToExtract', 'otherKeyToExract], 'Y-m-d H:i:s'));
$monolog->pushHandler($handler);