PHP code example of leon0399 / monolog-flysystem

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

    

leon0399 / monolog-flysystem example snippets




use Monolog\Logger;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local as LocalAdapter;

use Leon0399\MonologFlysystem\Handler\FlysystemStreamHandler;

$filesystem = new Filesystem(new LocalAdapter('storage'));

$handler = new FlysystemStreamHandler($filesystem, 'logs/laravel.log', Logger::WARNING);

// create a log channel
$log = new Logger('name');
$log->pushHandler($handler);

// add records to the log
$log->warning('Foo');
$log->error('Bar');