Log HTTP requests in Laravel Vapor applications
You can install the package via composer:
composer require ageekdev/vapor-http-logger
You can publish the config file with:
php artisan vendor:publish --provider="AgeekDev\HttpLogger\HttpLoggerServiceProvider" --tag="config"
This is the contents of the published config file:
return [
/*
* Automatic registration of middleware will only happen if this setting is `true`
*/
'enabled' => env('HTTP_LOGGER_ENABLED', true),
/*
* The log profile which determines whether a request should be logged.
* It should implement `LogProfile`.
*/
'log_profile' => \AgeekDev\HttpLogger\LogNonGetRequests::class,
/*
* The log writer used to write the request to a log.
* It should implement `LogWriter`.
*/
'log_writer' => \AgeekDev\HttpLogger\DefaultLogWriter::class,
/*
* The log channel used to write the request.
*/
'log_channel' => env('LOG_CHANNEL', 'stderr'),
/*
* The log level used to log the request.
*/
'log_level' => 'info',
/*
* List of request methods that will be logged.
*/
'request_methods' => ['post', 'put', 'patch', 'delete'],
/*
* Filter out body fields which will never be logged.
*/
'except' => [
'password',
'password_confirmation',
],
/*
* List of headers that will be sanitized. For example Authorization, Cookie, Set-Cookie...
*/
'sanitize_headers' => [],
];
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
This package contains code copied from Log HTTP requests
The MIT License (MIT). Please see License File for more information.