PHPackages                             codebuds/easyadmin-log-viewer-bundle - 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. codebuds/easyadmin-log-viewer-bundle

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

codebuds/easyadmin-log-viewer-bundle
====================================

A log viewer bundle for EasyAdmin 4 in Symfony applications

0.1.0(3mo ago)0212MITPHPPHP ^8.5CI passing

Since Sep 14Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/DennisdeBest/EasyAdminLogViewerBundle)[ Packagist](https://packagist.org/packages/codebuds/easyadmin-log-viewer-bundle)[ Docs](https://github.com/your-vendor/easyadmin-log-viewer-bundle)[ RSS](/packages/codebuds-easyadmin-log-viewer-bundle/feed)WikiDiscussions master Synced 1mo ago

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

EasyAdmin Log Viewer Bundle
===========================

[](#easyadmin-log-viewer-bundle)

A Symfony bundle that provides a log viewer interface for EasyAdmin 4, compatible with Symfony 7 and PHP 8.3.

Features
--------

[](#features)

- View log files directly from your EasyAdmin dashboard
- Download log files
- Delete log files
- Filter log entries by level and type
- Configurable route prefix

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

[](#requirements)

- PHP 8.5+
- Symfony 8+
- EasyAdmin 4

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

[](#installation)

Use Composer to install the bundle:

```
composer require codebuds/easyadmin-log-viewer-bundle
```

Configuration
-------------

[](#configuration)

Add the bundle to your `config/bundles.php`:

```
return [
    // ...
    EasyAdminLogViewerBundle::class => ['all' => true],
];
```

Create a configuration file `config/packages/easy_admin_log_viewer.yaml`:

```
easy_admin_log_viewer:
    route_prefix: '/admin'  # Default value, can be customized
    levels:
        - { level: 'INFO', class: 'info' }
        - { level: 'ERROR', class: 'danger' }
        - { level: 'CRITICAL', class: 'danger' }
        - { level: 'DEBUG', class: 'secondary' }
```

The level is what is automatically picked up from the log files. Then a CSS class can be set per level. By default the predefined Bootstrap styles can be used `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`

### Twig component

[](#twig-component)

A default path has to be added to the `twig_component.yaml` configuration file:

```
twig_component:
    defaults:
				#...
        CodeBuds\EasyAdminLogViewerBundle\Twig\Components\: '@EasyAdminLogViewer/components/'
```

Routing
-------

[](#routing)

The following needs to be added to the applications routes.yaml configuration file:

```
easy_admin_log_viewer:
  resource: '@EasyAdminLogViewerBundle/config/routes.yaml'
  prefix: '%easy_admin_log_viewer.route_prefix%'
```

### Customizing the Route Prefix

[](#customizing-the-route-prefix)

You can customize the route prefix in your configuration:

```
easy_admin_log_viewer:
    route_prefix: '/custom-admin'
```

This will change all log viewer routes to start with `/custom-admin` instead of the default `/admin`.

### Adding the log viewer to the dashboard

[](#adding-the-log-viewer-to-the-dashboard)

To see the log files the route can be added to your EasyAdmin dashboard controller:

```
