承接 khuetd/m2-custom-log 相关项目开发

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

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

khuetd/m2-custom-log

Composer 安装命令:

composer require khuetd/m2-custom-log

包简介

Improve the log for magento 2 with custom format

README 文档

README

``ktd/custom-log``

Main Functionalities

Improve the log for magento 2 with custom format

Installation

* = in production please use the --keep-generated option

Type 1: Zip file

  • Unzip the zip file in app/code/Ktd
  • Enable the module by running php bin/magento module:enable Ktd_LogHandler
  • Apply database updates by running php bin/magento setup:upgrade*
  • Flush the cache by running php bin/magento cache:flush

Type 2: Composer

  • Make the module available in a composer repository for example:
    • private repository repo.magento.com
    • public repository packagist.org
    • public github repository as vcs
  • Add the composer repository to the configuration by running composer config repositories.repo.magento.com composer https://repo.magento.com/
  • Install the module composer by running composer require ktd/custom-log
  • enable the module by running php bin/magento module:enable Ktd_LogHandler
  • apply database updates by running php bin/magento setup:upgrade*
  • Flush the cache by running php bin/magento cache:flush

Configuration

Use

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   /** @var \Ktd\LogHandler\Helper\Data $log */
$log = $objectManager->get('\Ktd\LogHandler\Helper\Data');

$log->setFuncDebug('saleorder'); //set filename
$logType = 'ORDER';
$logApiType = 'SO-ORDER';

$req = ['sample' => 1];
$res = ['success' => 1];

$apiname = 'http://URL_API';
$req = json_encode($req);
$res = json_encode($res);

$log->debuglog($logType, array(
    $logApiType,
    "API : $apiname",
    "REQ : $req",
    "RES : $res"
));

Result in log

Log path: MAGENTO_ROOT_FOLDER/var/log/api/saleorder_debug_2020-04-05.log

2020-04-05 13:08:25|DEBUG|8aprmocv1b38g4n3d809m8pr79|ORDER|SO-ORDER|API : http://URL_API|REQ : {"sample":1}|RES : {"success":1}

统计信息

  • 总下载量: 223
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2020-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固