PHP code example of cherry-project / logger

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

    

cherry-project / logger example snippets




use Cherry\Logger;

define('LOGS_DIR', __DIR__ . '/var/log');

$logger = new Logger('app-logs', LOGS_DIR);

$logger->info('Info Message');
$logger->warning('Warning Message');
$logger->error('Error Message');
$logger->debug('Debug Message');

$logger->info('Info Message 2')
    ->warning('Warning Message 2')
    ->error('Error Message 2')
    ->debug('Debug Message 2');

echo $logger->count();

$logger->clear();