jumptwentyfour/laravel-http-logger

A logger middleware for HTTP requests and responses

1.0.3 2022-06-22 11:23 UTC

This package is auto-updated.

Last update: 2024-12-22 16:53:52 UTC


README

Installation

You can install the package via composer:

composer require jumptwentyfour/laravel-http-logger

Optionally you can publish the config file with:

php artisan vendor:publish --provider="JumpTwentyFour\LaravelHttpLogger\ServiceProvider" --tag="config"

Usage

This packages provides a middleware which can be added as a global middleware or as a single route.

// In `app/Http/Kernel.php`

protected $middleware = [
    // ...
    
    \JumpTwentyFour\LaravelHttpLogger\Middleware\HttpLogger::class
];
// In a routes file

Route::post(...)->middleware(\JumpTwentyFour\LaravelHttpLogger\Middleware\HttpLogger::class);