PHP code example of andrey-tech / debug-logger-php

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

    

andrey-tech / debug-logger-php example snippets


use App\DebugLogger\DebugLogger;
use App\DebugLogger\DebugLoggerException;

try {
    // Устанавливаем каталог для сохранения лог-файлов
    DebugLogger::$logFileDir = 'logs/';

    $logFileName = 'debug_extensions.log';
    $logger = DebugLogger::instance($logFileName);

    // Включаем логирование
    $logger->isActive = true;

    // Сохраняем информацию о всех скомпилированных и загруженных модулях PHP
    $logger->save(get_loaded_extensions(), null, 'PHP modules');
    
    // Сохраняем версию движка Zend PHP
    $logger->save(zend_version(), null, 'Zend engine');

} catch (DebugLoggerException $e) {
    printf('Ошибка (%d): %s' . PHP_EOL, $e->getCode(), $e->getMessage());
}

$ composer 

"andrey-tech/debug-logger-php": "^2.0"

*** ytoqjz5 [2020-06-14 12:57:18.420258 +00:00 Δ- s, 0.69/2.00 MiB] ********************
PHP modules
[
    "Core",
    "bcmath",
    "calendar",
    "ctype"
]

*** ytoqjz5 [2020-06-14 12:57:18.421359 +00:00 Δ0.001101 s, 0.69/2.00 MiB] ********************
Zend engine
3.2.0