承接 shoesten-tag/log-http 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固