ayorinde-codes / requestlogger
A laravel request logger that logs requests ip, agent, payload request, payload response, Time of execution and url in the database within any request call
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-09-21 02:38:06 UTC
README
RequestLogger is a Laravel Package that makes it easy to log requests ip, agent(browser or postman), payload request, payload response, Time of execution and url in the database within any request call.
Requirements
This package requires:
PHP 7.1+
Installation
You can install the package via composer:
composer require ayorinde-codes/requestlogger
Append the following line to the providers key in config/app.php to register the package:
'providers' => [ Ayorindecodes\Requestlogger\RequestLoggerServiceProvider::class, ]
Usage
Kernel
Append the following to the Kernel App\Http\Kernel.php in the $routeMiddleware and $middlewareGroups add
protected $middlewareGroups = [ 'api' => [ 'request_logger' ] protected $routeMiddleware =[ 'request_logger'=>Ayorindecodes\Requestlogger\Middleware\RequestLoggerMiddleware::class, ]
run composer dump-autoload
Testing
composer test
Publish Package Assets (optional)
You may additionally publish the package configuration and language file using the vendor:publish Artisan command:
php artisan vendor:publish --provider="Ayorindecodes\Requestlogger\RequestLoggerServiceProvider"
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ayorinde223@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.