PHP code example of unicate / logger

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

    

unicate / logger example snippets




Dir = __DIR__ . '/../logs';

$logger = new \Unicate\Logger\Logger(LogLevel::ERROR, $logsDir, 'Appl-{Y-m-d}-test.txt');

$logger->debug('test some very detailed debug log {data}', ['data' => '...some data...']);
$logger->info('test loggin some info {kind} stuff', ['kind' => 'crazy']);
$logger->notice('Just for your notification.', []);
$logger->warning('Just be warned', []);
$logger->error('some error: {exception}', ['exception' => 'stack trace...']);
$logger->critical('A mission critical log entry!', ['exception' => 'Stack trace')]);
$logger->alert('Aleeeerrrrtt', []);
$logger->emergency('Its an Emergency', []);