codebuds/easyadmin-log-viewer-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

codebuds/easyadmin-log-viewer-bundle

最新稳定版本:1.1.0

Composer 安装命令:

composer require codebuds/easyadmin-log-viewer-bundle

包简介

A Symfony bundle that provides a log viewer interface for EasyAdmin backends

README 文档

README

A Symfony bundle that provides a log viewer interface for EasyAdmin backends.

Features

  • Browse available log files from the admin
  • View parsed log entries with multiline stack traces
  • Filter log entries by channel and level
  • Download log files
  • Delete log files
  • Configure the admin route prefix

Requirements

  • PHP 8.5+
  • Symfony 8+
  • EasyAdmin 4.29+ or 5.x

Installation

Install the bundle with Composer:

composer require codebuds/easyadmin-log-viewer-bundle

Symfony Flex should enable the bundle automatically. Without Flex, add it to config/bundles.php:

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

Configuration

The bundle works out of the box. If needed, create config/packages/easy_admin_log_viewer.yaml to override the defaults:

easy_admin_log_viewer:
    route_prefix: '/admin'
    levels:
        - { level: 'EMERGENCY', class: 'danger' }
        - { level: 'CRITICAL', class: 'danger' }
        - { level: 'ERROR', class: 'danger' }
        - { level: 'ALERT', class: 'danger' }
        - { level: 'WARNING', class: 'warning' }
        - { level: 'NOTICE', class: 'info' }
        - { level: 'INFO', class: 'info' }
        - { level: 'DEBUG', class: 'secondary' }

The configured class values map directly to Bootstrap contextual classes such as primary, secondary, success, danger, warning, info, light, and dark.

Routing

Routes are imported automatically by the bundle. You can customize the route prefix like this:

easy_admin_log_viewer:
    route_prefix: '/custom-admin'

Adding the Log Viewer to the Dashboard

Add the route to your EasyAdmin dashboard controller:

<?php

namespace App\Controller\Admin;

use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;

class DashboardController extends AbstractDashboardController
{
    #[\Override]
    public function configureMenuItems(): iterable
    {
        // ...
        yield MenuItem::linkToRoute('Logs', 'fa fa-file-alt', 'easy_admin_log_viewer_list')
            ->setPermission('ROLE_ADMIN');
        // ...
    }
}

Security

Only users with ROLE_ADMIN can access the log viewer interface. Make sure your admin area is properly secured.

Screenshots

List all log files

screen1.png

Show all lines

screen2.png

Filter by type

screen3.png

Filter by level

screen4.png

统计信息

  • 总下载量: 265
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固