PHP code example of wpjscc / reactphp-log

1. Go to this page and download the library: Download wpjscc/reactphp-log 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/ */

    

wpjscc / reactphp-log example snippets




use React\Stream;
use Wpjscc\Log\ConsoleFormatter;
use Wpjscc\Log\StreamHandler;
use Wpjscc\Log\FileWriteStream;
use Monolog\Logger;

rent process:
$handler = new StreamHandler(new Stream\WritableResourceStream(STDOUT));
$handler->setFormatter(new ConsoleFormatter);

$logger = new Logger('main');
$logger->pushHandler($handler);

$logger->debug("Hello, world!");
$logger->info("Hello, world!");
$logger->notice("Hello, world!");
$logger->error("Hello, world!");
$logger->alert("Hello, world!");