承接 magezone/magento2-logviewer 相关项目开发

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

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

magezone/magento2-logviewer

Composer 安装命令:

composer require magezone/magento2-logviewer

包简介

A Magento 2 module with Tracy debug, custom logger, and log view UI

README 文档

README

Data in log file can be saved in table format. In Magento admin you can assign formatters to table columns:

  1. Go to System > Tools > Log Viewer
  2. On the top of the page click on Manage column formatters
  3. Click on Add New Column Formatter

Form description:

  • Index: number coresponding to the array index of data when creating new log entry.
  • Name: heading for log column on this index.
  • Log File: log file path relative to var/log for which column formatter applies.
  • Formatter Class: Class used to format this column.

Formatter Classes:

  • StringData: Data is converted to string.
  • ExceptionData: Data must implement \Throwable interface. Saves Tracy bluescreen for Exception.
  • StructuredData: Object or array. It is saved in in browserable format.

Using custom logger

You need to add LogViewer Logger to dependancy injection, for example:

public function __construct(
	...
	\Magezone\LogViewer\Logger\Logger $logger
	...
)
...

Logged data must be an array. Each array value corresponds to one column in log view. If column formatter for selected log file and column index is not specified, StringData formatter is used. Number of array values must be constant for a log file. Logging levels are same as in default Monolog logger.

Exception logging example:

...
catch (\Throwable $e) {
	// in Magento admin, there is ExceptionData column formatter for file test.log and index 2
	$this->logger->warning('test.log', ['test log data', 'second column', $e]); 
}
...

Structured data example:

...
// in Magento admin, there is StructuredData column formatter for file test2.log and index 1
$data = ['person' => ['name' => 'Mikhael', 'age' => 24]];
$this->logger->debug('test2.log', ['some column', $data, 'other column']);
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2018-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固