shoesten-tag/log-http
最新稳定版本:v0.1.1
Composer 安装命令:
composer require shoesten-tag/log-http
包简介
Log HTTP requests and responses in Laravel applications using PHP attributes
关键字:
README 文档
README
Log HTTP requests and responses in Laravel applications using PHP attributes.
How to install
composer require shoesten-tag/log-http --dev
Notes
-
The default setting for both request and response logging is false. You can enable both by setting them to true or enable only one of them as needed.
-
Currently, logging is done only in the Laravel log file. However, if you change the logging channel, logs will be sent to the specified channel instead.
-
Not recommended for production use!
How to use
Add middleware to your routes
//Example Route::resource('/dashboard', DashboardController::class)->middleware('log-http');
Log the response within the method
#[Intercept(response: true)] public function index(){ return new Collection(Employee::all()); }
Log the request within the method
#[Intercept(request: true)] public function index(){ return new Collection(Employee::all()); }
Enable logging of requests and responses within the class
#[Intercept(request: true, response: true)] class EmployeeController extends Controller { public function index(){ return new Collection(Employee::all()); } }
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-03