PHP code example of ahsanrazib / log-viewer

1. Go to this page and download the library: Download ahsanrazib/log-viewer 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/ */

    

ahsanrazib / log-viewer example snippets


return [
    'enabled' => env('LOG_VIEWER_ENABLED', true),
    'passkey' => env('LOG_VIEWER_PASSKEY', null),
    'route_prefix' => env('LOG_VIEWER_ROUTE_PREFIX', 'log-viewer'),

    // Email Digest Notifications (production only)
    'email_notifications' => [
        'enabled' => (bool) env('LOG_VIEWER_EMAIL_ENABLED', false),
        'to' => env('LOG_VIEWER_EMAIL_TO', null),
        'interval_minutes' => (int) env('LOG_VIEWER_EMAIL_INTERVAL', 30),
        'levels' => ['ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY'],
    ],

    'storage_path' => storage_path('logs'),
    'per_page' => 50,
    'theme' => 'auto',
];

use Illuminate\Support\Facades\Schedule;

Schedule::command('log-viewer:send-email-digest')->everyThirtyMinutes();
bash
php artisan vendor:publish --provider="Ahsanrazib\LogViewer\LogViewerServiceProvider"