fsm/module-log-viewer

Magento / Mage-OS admin Log Viewer with per-role glob patterns and download ACL.

Maintainers

Package info

github.com/fabiano-mallmann/module-log-viewer

Type:magento2-module

pkg:composer/fsm/module-log-viewer

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-07-13 02:22 UTC

This package is auto-updated.

Last update: 2026-08-13 02:29:22 UTC


README

CI License: OSL-3.0 PHP

Admin Log Viewer for Magento Open Source / Mage-OS. Lists and displays files under var/log with per-role glob patterns and optional download permission.

Features

  • Grid of log files allowed for the current admin role
  • Tail view (last 512 KB) with in-page search
  • Download gated by ACL and role flag
  • Role tab under System → Permissions → User Roles to configure patterns

Requirements

  • PHP 8.2+
  • Magento Open Source / Mage-OS 2.4+ (compatible with Magento Backend, User, Authorization, UI)

Installation

Composer (recommended for distribution)

composer require fsm/module-log-viewer
bin/magento module:enable Fsm_LogViewer
bin/magento setup:upgrade
bin/magento cache:flush

App code

Copy this module to app/code/Fsm/LogViewer, then run the same module:enable / setup:upgrade commands.

Configuration

  1. Open System → Permissions → User Roles.

  2. Edit a role → Log Viewer tab.

  3. Enter one glob pattern per line (basename under var/log), for example:

    system.log
    exception.log
    
  4. Optionally enable Allow Download.

  5. Assign ACL resources under System → Tools → Log Viewer:

    • View Logs — list and open files
    • Download Logs — download (also requires the role flag)

Empty patterns mean the role sees no log files.

The Size column filter uses bytes (display is human-readable).

Security

Log files often contain personal data, stack traces, tokens, or other secrets.

  • Prefer specific patterns (system.log, exception.log) over *.log.
  • Grant Download only to roles that need full files.
  • The module rejects path traversal, null bytes, and symlinks under var/log.
  • Viewing still exposes file contents to anyone with View ACL and matching patterns — treat role setup as a security control.

To report vulnerabilities, see SECURITY.md.

ACL

Resource ID
Log Viewer Fsm_LogViewer::logviewer
View Logs Fsm_LogViewer::view
Download Logs Fsm_LogViewer::download

Development

Commit messages follow Conventional Commits.

Unit tests (standalone package)

composer install
composer run test

Unit tests (from Magento root)

vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist \
  app/code/Fsm/LogViewer/Test/Unit --no-extensions

Coding standard

vendor/bin/phpcs --standard=Magento2 app/code/Fsm/LogViewer

Coverage includes path/pattern safety, LogFileService (ACL, symlink, tail, download), repository, role-save plugin, listing DataProvider, role tab, and admin controllers.

Contributing

See CONTRIBUTING.md for setup, PR guidelines, and coding standards. Please follow the Code of Conduct.

Changelog

See CHANGELOG.md.

License

Open Software License (OSL 3.0) and Academic Free License (AFL 3.0). See COPYING.txt, LICENSE.txt, and LICENSE_AFL.txt.