1. Go to this page and download the library: Download larsgmortensen/litelog 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/ */
larsgmortensen / litelog example snippets
use LiteLog\LiteLog;
use LiteLog\LiteLog;
// Configure once at bootstrap
LiteLog::setDefaultDir('/path/to/logs');
LiteLog::setMaxFileSize(10 * 1024 * 1024); // 10 MB
LiteLog::setMaxRotatedFiles(5); // keep 5 rotated files
// Write a log line
LiteLog::log(
'app.json', // Log filename (relative to log dir)
'info', // Category
'Coffee supply is critically low', // Message (string or array)
['cups_left' => 1, 'developer' => 'Sleepy'] // Context (optional)
);