1. Go to this page and download the library: Download yapro/monolog-ext 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/ */
yapro / monolog-ext example snippets
$logger->info('I just got the logger');
$logger->error('An error occurred');
$logger->warning('My warning', array(
'my' => 'data',
'exception' => $e,// now you can see the above written custom stack trace as a string
));
$logger->warning('My second warning', array($e));// the short variant of version which you can see the above
$logger->error('An error occurred', [ 'my mixed type var' => (new VarHelper)->dump($myVar, 5) ] );
throw (new ExtraException())->setExtra('mixed data');
Cascade::fileConfig($config);
Log::info('Well, that works!');
Log::error('Maybe not...', ['some'=>'extra data']);