Looking to hire Laravel developers? Try LaraJobs

laravel-http-logger maintained by crows-feet

Description
Laravel request and response logger
Author
Last update
2020/07/21 07:43 (dev-develop)
License
Links
Downloads
128

Comments
comments powered by Disqus

Laravel HTTP logger

This is a package to log HTTP request and JSON response with Laravel

Installation

Require this package with composer.

composer require crows-feet/laravel-http-logger

Generate a migration and create it

php artisan queue:table

php artisan migrate

Configuration

To copy the package config to Laravel with the following publish command

php artisan vendor:publish --tag="http-logger-config"

Usage

To allow the logger for API routes, add the HttpLogger middleware to app/Http/Kernel.php:

protected $middlewareGroups = [
    // ...
    'api' => [
        // ...
        \CrowsFeet\HttpLogger\Middleware\JsonResponseLogger::class,
    ],
];

Start processing jobs on the queue as a daemon

php artisan queue:work