1. Go to this page and download the library: Download unifreak/qlog 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/ */
$log->shift(); // get the first record
$log->pop(); // get the last record
$log->stashed(); // get all records
$log->stashed(function($record) { // filter for specific records
// like: filter for records that have car_id and level greater than warning
return !empty($record['car_id']) && $record['level'] > QLogger::WARN;
});
$log->clean(); // clear all records
use QLog;
QLog::in('my_channel')->idBy('car_id', 123)->warning('somthing went wrong');
dump(QLog::stashed());
return [
// Disable QLog:
// - If disabled, all log methods call will simply be ignored
// - But if there is `qlog_debug` query parameter present, QLog will be auto-enabled
'disable' => false,
// redis connection config
'redis' => [
'host' => $redisHost,
'port' => $redisPort
],
// qlog config
'queue_name' => 'qlog:example.com',
'size' => 2000,
];
if (!class_exists('QLog')) {
class_alias(Unifreak\QLog\QLogFacade::class, 'QLog');
}
$app->configure('qlog');
$app->register(Unifreak\QLog\QLogServiceProvider::class);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.