PHP code example of guidofaecke / monolog-stdout-handler

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

    

guidofaecke / monolog-stdout-handler example snippets



use Monolog\Logger;
use Monolog\Handler\StdoutHandler;

$stdoutHandler = new StdoutHandler();
$logger = new Logger('cronjob');
$logger->pushHandler($stdoutHandler);

$logger->error('[c=green]Hello world![/c]');


use Monolog\Formatter\NoColorLineFormatter;
  
$stdoutHandler->setFormatter(new NoColorLineFormatter(StdoutHandler::FORMAT));