PHP code example of cqcqs / laravel-logger

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

    

cqcqs / laravel-logger example snippets


return [
    // 启用状态
    'enable' => true,
    // 需要收集的日志通道,默认所有
    'channels' => [],
    // 日志路径
    'path' => storage_path('logs/all.log'),
    
    // 请求日志
    'request' => [
        // 请求日志状态
        'enable' => true,
        // 需要排除的路由别名
        'except_routes' => [],
        // 头部日志
        'header' => false,
        // body日志
        'body' => false,
        // 响应日志
        'response' => false,
        // 日志
        'log' => [
            'driver' => 'daily',
            'path' => storage_path('logs/io.log'),
            'level' => 'info',
        ]
    ]
];

Cqcqs\Logger\Providers\LoggerProvider::class
bash
php artisan logger:publish