PHP code example of processhub / laravel-logs

1. Go to this page and download the library: Download processhub/laravel-logs 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/ */

    

processhub / laravel-logs example snippets


    'channels' => [
        // … existing channels
        'processhub' => [
            'driver' => 'custom',
            'via'    => ProcessHub\Logs\Logging\ProcessHubFactory::class,
            'level'  => env('LOG_LEVEL', 'warning'),
        ],
    ],
    'stack' => [
        'driver'   => 'stack',
        'channels' => ['single', 'processhub'],
        'ignore_exceptions' => false,
    ],
    

Schedule::command('processhub:flush-fallback --limit=100 --rate=20 --max-runtime=240')
    ->everyFiveMinutes()->withoutOverlapping(10)->runInBackground();

    ->withExceptions(function (Exceptions $exceptions) {
        $exceptions->reportable(fn (\Throwable $e) => \ProcessHub\Logs\Jobs\SendLogBatchJob::isOwnFailure($e) ? false : null);
        Integration::handles($exceptions);
    })
    
bash
    php artisan processhub:test
    
bash
    php artisan processhub:flush-fallback --rate=40 --max-runtime=5400