PHP code example of alexpts / php-logs-aggregator

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

    

alexpts / php-logs-aggregator example snippets



use PTS\LogsAggregator\LogsAggregator;

$logger = new LogsAggregator;

$logger->emergency('Message 1');
$logger->alert('DB not avaible', ['node' => '127.0.0.1']);
$logger->critical('Permission denied', ['userId' => 1, 'uri' => '/admin/settings']);
$logger->error('Some error');
...

$logs = $logger->getRecords();
$logger->reset();

$ composer