1. Go to this page and download the library: Download gbox/minilog 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/ */
gbox / minilog example snippets
box\Minilog as Logger;
// Minilog($logname [, $options[] ])
Logger::setup('logName', [
// write log entries to the console
'console' => true, // bool : defaults true
// defines where log files should be written to
'dir' => './logs', // string : defaults '.'
// defines the minimum RFC 5424 level to log
'level' => 'DEBUG', // string : defaults 'DEBUG'
// defines whether to log the path and line number of the log call
'linenos' => true, // bool : defaults true
// defines the timestamp format
'timestamp' => '[Y-m-d H:m:s]', // string : you can change this if you want
]);
Logger::debug('testing', 'message', 'here'); // testing message here
Logger::info('testing', 'message', 'here'); // testing message here
Logger::notice('testing', 'message', 'here'); // testing message here
Logger::warning('testing', 'message', 'here'); // testing message here
Logger::error('testing', 'message', 'here'); // testing message here
Logger::critical('testing', 'message', 'here'); // testing message here
Logger::alert('testing', 'message', 'here'); // testing message here
Logger::emergency('testing', 'message', 'here'); // testing message here