Skip to content

malvik-lab/laravel-http-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Http Logger

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.

Installation

$ composer require malvik-lab/laravel-http-logger

Publish config file

$ php artisan vendor:publish --tag=malviklab-laravel-http-logger-config

Publish migration file

$ php artisan vendor:publish --tag=malviklab-laravel-http-logger-migrations

Run migration

$ php artisan migrate

(Recommended) Use on Global Middleware

// app/Http/Kernel.php
protected $middleware = [
    \MalvikLab\LaravelHttpLogger\Http\Middleware\LaravelHttpLoggerMiddleware::class,
    // ...
];

(Alternative) Use on your routes

Route::middleware(['malviklab-laravel-http-logger'])->group(function () {
    // your routes here
});

Configuration

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',
    ],
];

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages