PHP code example of songhieu / monitor-track-laravel
1. Go to this page and download the library: Download songhieu/monitor-track-laravel 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/ */
songhieu / monitor-track-laravel example snippets
// config/logging.php (added for you if missing)
'monitor-track' => [
'driver' => 'custom',
'via' => MonitorTrack\Monolog\ChannelFactory::class,
'level' => env('MT_LOG_LEVEL', 'debug'),
],
use MonitorTrack\Facades\MonitorTrack;
MonitorTrack::log('warning', 'Payment retry scheduled', ['order_id' => 991]);
MonitorTrack::captureException($e, ['order_id' => 991]);
// Work outside Laravel's queue / scheduler:
MonitorTrack::trackJob('imports', ImportCsv::class, fn () => $importer->run());
MonitorTrack::trackCron('reports:nightly', '0 2 * * *', fn () => $reports->build());
MonitorTrack::stats(); // ['emitted' => …, 'dropped' => …, 'sampled' => …, 'errors' => …]
MonitorTrack::flush(); // http transport: send the buffer now (2 s budget)
MonitorTrack::flushIfDue(); // http transport: send if 2 s passed or 500 events wait (daemon loops)
text
N+1 query: 37× select * from `users` where `users`.`id` = ? limit ? GET /orders/{order}
app/Http/Controllers/OrderController.php:42 App\Http\Controllers\OrderController->index
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.