PHP code example of reactphp-x / log
1. Go to this page and download the library: Download reactphp-x/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/ */
reactphp-x / log example snippets
use React\Stream;
use ReactphpX\Log\ConsoleFormatter;
use ReactphpX\Log\StreamHandler;
use ReactphpX\Log\FileWriteStream;
use Monolog\Logger;
ess:
$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!");