PHPackages                             eurekos/symfony-monolog-viewer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. eurekos/symfony-monolog-viewer

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

eurekos/symfony-monolog-viewer
==============================

A simple Symfony bundle to view Monolog log files in the browser.

v0.1.0(1mo ago)01↓85.7%MITPHPPHP &gt;=8.1

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/eurekos/symfony-monolog-viewer)[ Packagist](https://packagist.org/packages/eurekos/symfony-monolog-viewer)[ RSS](/packages/eurekos-symfony-monolog-viewer/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Eurekos Symfony Monolog Viewer
==============================

[](#eurekos-symfony-monolog-viewer)

A Symfony bundle to view Monolog log files in the browser.

What it does:

- Lists the `.log` files in your log directory (by default `var/log`).
- Shows the last lines of a file, parsed into entries (time, level, channel, message), newest first. Multi-line entries such as stack traces stay grouped.

It reads log **files** from a directory. That covers Monolog's common file-based handlers (`StreamHandler`, `RotatingFileHandler`). Logs sent only to other destinations (syslog, a database, a remote service, etc.) are not shown, because there is no file to read.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Symfony 6.4, 7.x or 8.x (`symfony/twig-bundle`)

Installation
------------

[](#installation)

```
composer require eurekos/symfony-monolog-viewer
```

If you don't use Symfony Flex, register the bundle manually in `config/bundles.php`:

```
return [
    // ...
    Eurekos\SymfonyMonologViewer\EurekosSymfonyMonologViewerBundle::class => ['all' => true],
];
```

Configuration (optional)
------------------------

[](#configuration-optional)

Defaults are usually fine. To override the directory or how many lines are tailed, create `config/packages/eurekos_symfony_monolog_viewer.yaml`:

```
eurekos_symfony_monolog_viewer:
    dir: '%kernel.logs_dir%'  # default: your var/log
    max_lines: 200            # default: 200
```

Setup
-----

[](#setup)

This bundle ships an **abstract** controller. You enable the viewer by extending it in your own application: you choose the path prefix and the access control, and the routes are inherited from the base controller.

Create `src/Controller/MonologViewerController.php`:

```
namespace App\Controller;

use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Eurekos\SymfonyMonologViewer\Controller\MonologViewerController as BaseMonologViewerController;

#[Route('/admin/logs')] // path prefix for the controllers
#[IsGranted('ROLE_ADMIN')] // alternatively, protect it with a firewall
final class MonologViewerController extends BaseMonologViewerController
{
}
```

With the default Symfony route configuration (which loads attribute routes from `src/Controller/`), this registers:

Route namePath`eurekos_monolog_viewer_index``/admin/logs``eurekos_monolog_viewer_file``/admin/logs/{name}`The viewer is then available at `/admin/logs`.

### Notes

[](#notes)

- The base controller is autowired into your subclass automatically (it needs Twig and an internal log-reading service). You don't declare a constructor unless you want to.
- Create **exactly one** subclass. The route names are defined on the base controller's actions, so several subclasses would clash.
- Don't set a `name:` prefix on the class-level `#[Route]`, otherwise the internal template links (which use the route names above) won't resolve.
- If you prefer a firewall to `#[IsGranted]`, guard the prefix instead:

    ```
    # config/packages/security.yaml
    access_control:
        - { path: ^/admin/logs, roles: ROLE_ADMIN }
    ```

Log files can contain sensitive data, so always protect your route. (Output is HTML-escaped by Twig, so log content can't inject markup into the page.)

How it works
------------

[](#how-it-works)

`LogManager` lists `*.log` files in the configured directory and, for a chosen file, reads the last `max_lines` lines by scanning backwards from the end of the file (so large files aren't loaded into memory). Lines matching Monolog's default format are parsed; lines that don't match are treated as continuations of the previous entry.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35bc0bb35837e6defd32d8cc3335ea8257446ec734f0bf6aa9c79feb6981285d?d=identicon)[pavloshevchuk](/maintainers/pavloshevchuk)

---

Top Contributors

[![pavloshevchuk](https://avatars.githubusercontent.com/u/10268035?v=4)](https://github.com/pavloshevchuk "pavloshevchuk (3 commits)")

---

Tags

symfonybundlelogsmonologViewer

### Embed Badge

![Health badge](/badges/eurekos-symfony-monolog-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/eurekos-symfony-monolog-viewer/health.svg)](https://phpackages.com/packages/eurekos-symfony-monolog-viewer)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M400](/packages/easycorp-easyadmin-bundle)[symfony/web-profiler-bundle

Provides a development tool that gives detailed information about the execution of any request

2.3k160.5M1.3k](/packages/symfony-web-profiler-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M215](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k64](/packages/open-dxp-opendxp)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.2k18.1k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
