fdekker / log-viewer-bundle
A log viewer bundle for Symfony 6 and up
Installs: 15 319
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 1
Forks: 2
Open Issues: 5
Type:symfony-bundle
Requires
- php: >=8.1
- ext-json: *
- psr/clock: ^1.0
- symfony/config: ^6.0||^7.0
- symfony/dependency-injection: ^6.0||^7.0
- symfony/filesystem: ^6.0||^7.0
- symfony/finder: ^6.0||^7.0
- symfony/framework-bundle: ^6.0||^7.0
- symfony/http-foundation: ^6.0||^7.0
- symfony/http-kernel: ^6.0||^7.0
- symfony/routing: ^6.0||^7.0
- symfony/validator: ^6.0||^7.0
Requires (Dev)
- digitalrevolution/accessorpair-constraint: ^2.1.18
- digitalrevolution/phpunit-extensions: ^1.3
- digitalrevolution/phpunit-file-coverage-inspection: ^v2.0
- mikey179/vfsstream: ^1.6.11
- phpmd/phpmd: ^2.14
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpstan/phpstan-symfony: ^1.3
- phpunit/phpunit: ^10.5 || ^11.0
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.6
- symfony/browser-kit: ^6.0||^7.0
- symfony/console: ^6.0||^7.0
- symfony/css-selector: ^6.0||^7.0
- symfony/http-client: ^6.0||^7.0
- symfony/monolog-bridge: ^6.0||^7.0
- symfony/monolog-bundle: ^3.10
- symfony/phpunit-bridge: ^6.4||^7.0
- symfony/runtime: ^6.0||^7.0
- symfony/templating: ^6.0||^7.0
- symfony/twig-bundle: ^6.0||^7.0
- symfony/web-profiler-bundle: ^6.0||^7.0
- symfony/yaml: ^6.0||^7.0
- twig/twig: ^3.8.0
Suggests
- ext-zip: To use the zip download feature
- symfony/http-client: Required for the remote hosts feature
- dev-master
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.1
- v0.1.0
- dev-renovate/eslint-monorepo
- dev-renovate/typescript-5.x-lockfile
- dev-renovate/sass-1.x-lockfile
- dev-renovate/vite-6.x
- dev-Add-date-range-picker
- dev-renovate/major-eslint-monorepo
This package is auto-updated.
Last update: 2024-12-13 22:56:36 UTC
README
Log viewer for Symfony
Inspired by opcodesio/log-viewer for LaravelLog Viewer: a bundle for your Symfony app. It provides a user-friendly UI to read, filter and search log files.
Out of the box it will read your Monolog logs in the var/log
directory, but can be configured to
read logs from any directory.
Features
- 📂 View all the Monolog logs in the
%kernel.logs_dir%
directory, - 📂 View other types of logs - Apache, Nginx, or custom logs,
- 🔍 Search the logs,
- 🔍 Filter by log level (error, info, debug, etc.), by channel, date range or log content inclusion or exclusion,
- 🔍 Search multiple log files at once,
- 🌑 Dark mode,
- 🕑 Present log entries in your local timezone,
- 🖥️ Multiple host support,
- 💾 Download or delete log files from the UI,
- ☎️ API access for folders, files & log entries,
Getting started
Requirements
- PHP 8.1+
- Symfony 6.0+ or 7.0+
Installation
Use composer.
composer require fdekker/log-viewer-bundle
If you don't use Symfony Flex, you'll need to manually enable the bundle:
# /config/bundles.php return [ // ... FD\LogViewer\FDLogViewerBundle::class => ['all' => true], ];
And add the route by creating file /config/routes/fd_log_viewer.php
:
<?php use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return static function (RoutingConfigurator $routingConfigurator): void { $routingConfigurator->import('.', 'fd_symfony_log_viewer')->prefix('/log-viewer'); };
⚠ Ensure access to your logs are secure by adding the line below to /config/packages/security.php
:
return static function (SecurityConfig $security): void { ... $security->accessControl()->path('^/log-viewer')->roles(['ROLE_ADMIN']); };
After installing the package, publish the front-end assets by running:
php bin/console assets:install
Usage
Once the installation is complete, you will be able to access Log Viewer directly in your browser.
By default, it is available at: /log-viewer
on your domain.
Configuration
Default configuration: (Configuration reference)
fd_log_viewer: home_route: null log_files: monolog: type: monolog name: Monolog finder: in: "%kernel.logs_dir%" name: "*.log" depth: '== 0' ignoreUnreadableDirs: true followLinks: false downloadable: false deletable: false start_of_line_pattern: '/^\[\d{4}-\d{2}-\d{2}[^]]*]\s+\S+\.\S+:/' log_message_pattern: '/^\[(?P<date>[^\]]+)\]\s+(?P<channel>[^\.]+)\.(?P<severity>[^:]+):\s+(?P<message>.*)\s+(?P<context>[[{].*?[\]}])\s+(?P<extra>[[{].*?[\]}])\s+$/s' date_format: null hosts: localhost: name: Local host: null
Read more: