PHP code example of codememory / logging

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

    

codememory / logging example snippets



use Codememory\Components\Logging\Logging;

е логгера из конфигурации
$logging->executeLogger('phpError');

use Codememory\Components\Logging\Handlers\StreamHandler;
use Codememory\Components\Logging\Logger;

// Добавление обработчика
$logging->addHandler('new-handler', StreamHandler::class, Logger::ERROR);

// Добавление логгера
$logging->addLogger('my-logger', 'new-handler', [
    'path' => 'my-log.log'
])
->error('Сообщение логгера', ['context-data'])
->addExtra(['extra-data']);