承接 fdekker/log-viewer-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fdekker/log-viewer-bundle

Composer 安装命令:

composer require fdekker/log-viewer-bundle

包简介

A log viewer bundle for Symfony 6 and up

README 文档

README

License Minimum PHP Version Minimum Symfony Version Vuejs codecov Run tests

Log viewer for Symfony

Inspired by opcodesio/log-viewer for Laravel log-viewer

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 .gz files 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 .gz compressed 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 fdekker/log-viewer-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 87.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 43
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 43
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-21