debugged/apilogger
最新稳定版本:2.0.0
Composer 安装命令:
composer require debugged/apilogger
包简介
A Laravel package for logging API requests and responses
README 文档
README
A simple Laravel package to log API requests and responses.
Installation
You can install the package via composer:
composer require debugged/apilogger
Configuration
- Publish the migration:
php artisan vendor:publish --provider="debugged\ApiLogger\ApiLoggerServiceProvider" --tag="migrations"
- Run the migrations:
php artisan migrate
- Add the middleware to your
app/Http/Kernel.phpfile in the$middlewareGroupsarray:
protected $middlewareGroups = [ 'api' => [ // ... other middleware \debugged\ApiLogger\Http\Middleware\APILog::class, ], ];
Usage
Once installed and configured, the package will automatically log all API requests and responses to the logs table. Each log entry includes:
- HTTP method
- URL
- IP address
- User agent
- Request data
- Response data
- Status code
- Timestamps
License
The MIT License (MIT).
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-27