fdekker/log-viewer-bundle
Composer 安装命令:
composer require fdekker/log-viewer-bundle
包简介
A log viewer bundle for Symfony 6 and up
README 文档
README
Log viewer for Symfony
Inspired by opcodesio/log-viewer for Laravel
Log 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,
- 📂 Read compressed log files - only
.gzfiles supported, - 🔍 Search the logs,
- 🔍 Filter by log level (error, info, debug, etc.), by channel, date range or log content inclusion or exclusion,
- 🔍 Show context lines before and/or after the log entry matches,
- 🔍 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+, 7.0+ or 8.0+
- ext-zlib (optional, required to read
.gzcompressed log files)
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 show_performance_details: true log_files: monolog: type: monolog name: Monolog finder: in: "%kernel.logs_dir%" name: "*.log" depth: '== 0' ignoreUnreadableDirs: true followLinks: false open: 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:
fdekker/log-viewer-bundle 适用场景与选型建议
fdekker/log-viewer-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 87.36k 次下载、GitHub Stars 达 43, 最近一次更新时间为 2024 年 01 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「logs」 「log viewer」 「symfony-bundle」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fdekker/log-viewer-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fdekker/log-viewer-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fdekker/log-viewer-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The tenancy/tenancy logs mutations
The bundle for easy using json-rpc api on your project
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Laravel 5.x.x library for integration Monolog Sentry
Bundle Symfony DaplosBundle
Pacote simplificado para persistência de logs
统计信息
- 总下载量: 87.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 43
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-21