mageprince/module-log-viewer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mageprince/module-log-viewer

Composer 安装命令:

composer require mageprince/module-log-viewer

包简介

Magento 2 Log Viewer Extension

README 文档

README

Mageprince Log Viewer is a powerful admin utility that allows you to manage, monitor, and debug log files directly from the Magento Admin Panel — without needing to access the server or filesystem.

✅ Compatibility

Magento Open Source: 2.3.x - 2.4.x

✨ Key Features

Log File List

  • Browse all log files in var/log/ directly from the admin panel
  • Search log files by filename
  • Sort by filename, file size, or last modified time
  • Pagination support for large log directories

Log Viewer

  • View the latest log lines with configurable line count
  • Load Previous Logs — paginate backwards through the file without loading it all at once
  • Live Log — auto-refreshes every 3 seconds to tail new entries in real time
  • Wrap Lines toggle for better readability of long lines
  • Clear Log — clears the current view without affecting the file on disk

Full-File Search

  • Search across the entire log file, not just the visible lines — works on files of any size (including multi-GB logs)
  • Returns the last 20 matching lines; click Load Previous Logs to page through earlier results

File Operations

  • Download log files directly from the admin
  • Truncate (clear file content) with confirmation prompt
  • Role-based access control — download and delete can be independently restricted per admin role

⚙️ Admin Configuration (Stores → Configuration → MagePrince → Log Viewer)

Setting Description
Enable Toggle the entire module on or off
Lines to Show Number of lines tailed per view (default 500)
Items Per Page Log file list page size (default 10)
Default Sort Column name, size, or mod_time
Default Sort Direction asc or desc
Allow Delete Show or hide the Truncate button
Allow Download Enable or disable file download

🔒 Security

  • Path traversal prevention — all file access is validated against var/log/ using real path resolution
  • Search query sanitisation — null bytes and control characters stripped before regex matching
  • Role-based ACL with four granular resources: View, Download, Delete, Settings

🚀 Installation Instructions

1. Install via Composer (Recommended)

composer require mageprince/module-log-viewer
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

2. Manual Installation

Copy the contents of this repository to app/code/Mageprince/LogViewer, then run:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

🤝 Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

🛠 Support

If you encounter any problems or bugs, please open an issue on GitHub.

📸 Screenshots

image image

mageprince/module-log-viewer 适用场景与选型建议

mageprince/module-log-viewer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.15k 次下载、GitHub Stars 达 45, 最近一次更新时间为 2025 年 07 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mageprince/module-log-viewer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mageprince/module-log-viewer 我们能提供哪些服务?
定制开发 / 二次开发

基于 mageprince/module-log-viewer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-07-18