PHP code example of ajaxy / logger

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

    

ajaxy / logger example snippets




use Ajaxy\Logger\Logger;
use Ajaxy\Logger\Handler\Stream;

// create a log channel
$log = new Logger();
$log->pushHandler(new Stream('path/to/dir/', Logger::WARNING));

// dynamic logging
$log->debug('Foo');
$log->error('Bar');

// this will save the logging to anything.log
$log->{anything}('Bar');