jezzdk / laravel-request-log
在数据库中记录所有请求。
1.0.1
2020-09-15 10:56 UTC
Requires
- php: ^7.2
Requires (Dev)
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-09-15 20:33:03 UTC
README
在数据库中记录所有请求。此包不会存储有效载荷。
安装
您可以通过composer安装此包
composer require jezzdk/laravel-request-log
您可以使用以下命令发布和运行迁移
php artisan vendor:publish --provider="Jezzdk\LaravelRequestLog\RequestLogServiceProvider" --tag="migrations" php artisan migrate
您可以使用以下命令发布配置文件
php artisan vendor:publish --provider="Jezzdk\LaravelRequestLog\RequestLogServiceProvider" --tag="config"
这是已发布配置文件的内容
return [ /** * Enable the request log (default is false). */ 'enabled' => env('REQUEST_LOG_ENABLED', false), /** * Max age in days. * * Entries older than this will be deleted by the scheduled task. */ 'max_age' => 90, /** * The model used for storing the request data. * * You might want to override this if you're using a multi-tenancy package, * or if you want to store other data. */ 'model' => Jezzdk\LaravelRequestLog\RequestLog::class, ];
用法
将以下中间件添加到任何您想记录请求的中间件堆栈中
// app/Http/Kernel.php protected $middleware = [ ... \Jezzdk\LaravelRequestLog\Middleware\LogRequest::class ]
将清理命令添加为计划任务
// app/Console/Kernel.php $schedule->command('request-log:clean')->daily();
测试
composer test
更新日志
有关最近更改的更多信息,请参阅更新日志。
安全
如果您发现任何与安全相关的问题,请发送电子邮件至jess@stopa.dk,而不是使用问题跟踪器。
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。