huchunguang/requestlogdb
Composer 安装命令:
composer require huchunguang/requestlogdb
包简介
log all the information of request
README 文档
README
How To Use
- First, Pls.ensuring you have already installed the Laravel framework,then following the below the commnad
composer require "huchunguang/requestlogdb:4.0"
- After installation,you're able to exectue the artisan's command to publish our configuation into you config folder
php artisan vendor:publish
now, you could see a list of provider of vendor,to opt the RequestLog provider to do this,by the way, you could directly use option to determine which provider you would like to publish at this time,as you can see the below sample
php artisan vendor:publish --provider=Qnn\RequestLog\RequestLogProvider
-
so far,you already completed the installation,then we just need to use it in your project,for that,you need to configure those keys into your .env conf.
request_log_ip
request_log_port -
you can create a middleware to integrate the library,to refer the logrequestDB configration file,you can see all the fields the logging required, be aware of the type of value,and you could use an array to store the fields,after that,you just need call the method of send by using the Facade of RequestLog,almost like this
$data = array(
'user_id' => $user_id,
'user_token' => $token,
'app_id' => self::$app_id,
'ud_id' => self::$ud_id,
'api_name' => self::$api_name,
'param' => self::$param,
'request_method' => self::$request_method,
'status' => self::$status,
'err_code' => self::$err_code,
'err_message' => self::$err_message,
'user_sys' => self::$user_sys,
'user_phone' => self::$user_phone,
'user_ip' => self::$user_ip,
'server_ip' => self::$server_ip,
'host' => $request->getHost(),
'end_time' => time(),
'spend_time' => Dh::microTimeFloat() - self::$star_time
);
RequestLog::send($data);
License
The library is open-source software licensed under the MIT license.
huchunguang/requestlogdb 适用场景与选型建议
huchunguang/requestlogdb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 huchunguang/requestlogdb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 huchunguang/requestlogdb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-09