1. Go to this page and download the library: Download maatify/slim-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/ */
maatify / slim-logger example snippets
use Maatify\SlimLogger\Log\Logger;
use Maatify\SlimLogger\Log\LogLevelEnum;
use Maatify\SlimLogger\Store\File\Path;
$logger = new Logger(new Path(__DIR__));
$logger->record('User login', null, 'user/actions', LogLevelEnum::Info);
$app->post('/action', function ($request, $response) use ($logger) {
$logger->record('User posted action.', $request, 'user/submit', LogLevelEnum::Debug);
return $response;
});
use Maatify\SlimLogger\Log\Logger;
use Maatify\SlimLogger\Log\LogLevelEnum;
Logger::recordStatic('Static log entry.', null, 'system/status', LogLevelEnum::Info);