PHP code example of mradang / laravel-log

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

    

mradang / laravel-log example snippets


// 迁移日志到文件
$schedule
    ->call(function () {
        try {
            \mradang\LaravelLog\Services\LogService::migrateToFile();
        } catch (\Exception $e) {
            logger()->warning(sprintf('Kernel.schedule 迁移日志到文件失败:%s', $e->getMessage()));
        }
    })
    ->cron('0 0 2 * *')
    ->name('LogService::migrateToFile')
    ->withoutOverlapping();

void L($msg, $username = null)

Route::post('lists', [mradang\LaravelLog\Controllers\LogController::class, 'lists']);
bash
php artisan migrate:refresh