michelmelo/laravel-request-logging

记录所有请求及其响应

1.0.3 2023-11-18 15:13 UTC

This package is auto-updated.

Last update: 2024-09-18 16:48:36 UTC


README

Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.

此Laravel包包含中间件,用于记录请求及其响应,包括所有参数。

安装

您可以使用Composer进行安装

composer require michelmelo/laravel-request-logging

下一步是在您的app/Http/Kernel.php文件中添加中间件。

将请求记录添加到所有路由中

protected $middleware = [
    ...
    \MichelMelo\RequestLogging\LogRequest::class,
    ...
];

或者仅针对特定路由(组)。

protected $routeMiddleware = [
    ...
    'logRequest' => \MichelMelo\RequestLogging\LogRequest::class,
    ...
];

最后,虽然这是可选的,您可以发布配置文件

php artisan vendor:publish --provider="MichelMelo\RequestLogging\RequestLoggingServiceProvider"