PHP code example of pmjones / stdlog

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

    

pmjones / stdlog example snippets


use pmjones\Stdlog\Stdlog;

$log = new Stdlog();

// info level logs to STDOUT
$log->info('Hello world!');

// all other levels log to STDERR
$log->error('Other world!');

use pmjones\Stdlog\Stdlog;

$log = new Stdlog(
    stdout: fopen('php://memory', 'w'),
    stderr: fopen('php://memory', 'w')
);

// info level logs to STDOUT
$log->info('Hello world!');

// all other levels log to STDERR
$log->error('Other world!');