The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
628 Ready
462 Need Help
🏆 Leaderboard
Actively Maintained v1.0.9

Magento 2 Log Viewer

mageprince/module-log-viewer

Enables viewing, searching, and managing Magento log files directly from the admin panel. Allows downloading and deleting logs without server access.

24,821
Downloads
Below average
45
GitHub Stars
2x above avg
1mo ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
34 warnings
PHPStan Failed

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.0.9 on Magento 2.4.9
Jun 1, 2026
v1.0.8 on Magento 2.4.9
May 26, 2026
v1.0.8 on Magento 2.4.8-p4
May 11, 2026
v1.0.7 on Magento 2.4.8-p4
Mar 21, 2026
v1.0.7 on Magento 2.4.8-p3
Dec 30, 2025

Share This Module's Status

Magento 2 Log Viewer Magento compatibility status badge

README

Loaded from GitHub

Magento 2 Log Viewer

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

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.