PHP code example of femtopixel / monolog-csvhandler

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

    

femtopixel / monolog-csvhandler example snippets




use Monolog\Logger;
use FemtoPixel\Monolog\Handler\CsvHandler;

// create a log channel
$log = new Logger('name');
$log->pushHandler(new CsvHandler('path/to/your.csv', Logger::WARNING));

// add records to the log
$log->addWarning('Foo');
$log->addError('Bar');