Log every request and response of Laravel PHP Framework.
The package saves all the data of the requests and responses in the "request_log" table, but if you want you can use a custom adapter.
$ composer require malvik-lab/laravel-http-logger
$ php artisan vendor:publish --tag=malviklab-laravel-http-logger-config
$ php artisan vendor:publish --tag=malviklab-laravel-http-logger-migrations
$ php artisan migrate
// app/Http/Kernel.php
protected $middleware = [
\MalvikLab\LaravelHttpLogger\Http\Middleware\LaravelHttpLoggerMiddleware::class,
// ...
];
Route::middleware(['malviklab-laravel-http-logger'])->group(function () {
// your routes here
});
In the configuration file you can set any values present in the requests and responses to be hidden (eg password or access token), the word with which to hide and the adapter to be used for saving.
<?php
// config/malviklab-laravel-http-logger.php
return [
'storageAdapter' => MalvikLab\LaravelHttpLogger\Http\Middleware\Adapters\DbAdapter::class,
'hiddenText' => '[ *** HIDDEN *** ]',
'keysToHide' => [
'Authorization',
'password',
'token',
],
];