PHP code example of epigra / httplogger

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

    

epigra / httplogger example snippets


// in `app/Http/Kernel.php`

protected $middleware = [
    // ...
    
    \Epigra\HttpLogger\Middlewares\HttpLogger::class
];

// in a routes file

Route::post('/submit-form', function () {
    //
})->middleware(\Epigra\HttpLogger\Middlewares\HttpLogger::class);

    'http-logger' => [
        'driver' => 'daily',
        'path' => storage_path('logs/responses_requests.log'),
    ],
bash
php artisan vendor:publish --provider="Epigra\HttpLogger\HttpLoggerServiceProvider" --tag="config" 

LOG_REQUESTS=true
LOG_RESPONSES=true