mageprince / module-log-viewer

mageprince/module-log-viewer

Magento 2 Log Viewer Extension

  • Mageprince
magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass GPL-3.0-or-later

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

image image

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.0.9 stable Fail Magento 2.4.7-2.4.9 Details 2026-05-30 12:51:34
1.0.8 stable Not tested Not yet tested Details 2026-05-11 13:40:10
1.0.7 stable Not tested Not yet tested Details 2025-12-17 10:32:26
1.0.6 stable Not tested Not yet tested Details 2025-11-22 13:51:00
1.0.5 stable Not tested Not yet tested Details 2025-09-23 06:59:28
1.0.4 stable Not tested Not yet tested Details 2025-09-12 03:40:11
1.0.3 stable Not tested Not yet tested Details 2025-08-26 06:04:00
1.0.2 stable Not tested Not yet tested Details 2025-08-19 12:21:57
1.0.1 stable Not tested Not yet tested Details 2025-08-07 07:27:27
1.0.0 stable Not tested Not yet tested Details 2025-07-18 17:06:09

No dependencies declared

This package's composer.json doesn't declare any required, suggested, replaced, or conflicting packages.

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 29 29 warnings (ruleset: Magento2) — 29 auto-fixable with phpcbf
PHPMD Warning 5 5 rule violations (MissingImport:2, ExcessiveClassComplexity:1, CyclomaticComplexity:1, NPathComplexity:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 25 25
2.4.8 25 25
2.4.9 25 25

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
GPL-3.0-or-later
Authors

More from mageprince

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.