定制 dipeshshihora/laravel-log-viewer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dipeshshihora/laravel-log-viewer

最新稳定版本:v1.1.0

Composer 安装命令:

composer require dipeshshihora/laravel-log-viewer

包简介

Simple Laravel log viewer.

README 文档

README

Simple Log Viewer for Laravel 9, 10, 11 & 12 and Lumen. Install with composer, create a route to LogViewerController. No public assets, optional view/config publishing.

Install (Laravel)

Install via composer:

composer require dipeshshihora/laravel-log-viewer

If your app does not use package auto-discovery, add the Service Provider to config/app.php:

Dipesh\LaravelLogViewer\LaravelLogViewerServiceProvider::class,

Add a route in your routes/web.php:

use Dipesh\LaravelLogViewer\LogViewerController;

Route::get('logs', [LogViewerController::class, 'index'])->name('logs.index');

Go to /logs.

Install (Lumen)

Install via composer:

composer require dipeshshihora/laravel-log-viewer

Register in bootstrap/app.php:

$app->register(Dipesh\LaravelLogViewer\LaravelLogViewerServiceProvider::class);

Add route:

$router->get('logs', '\Dipesh\LaravelLogViewer\LogViewerController@index');

Advanced

Customize view

Publish the Blade view to resources/views/vendor/laravel-log-viewer/:

php artisan vendor:publish --provider="Dipesh\LaravelLogViewer\LaravelLogViewerServiceProvider" --tag=views

Edit configuration

Publish the configuration file config/logviewer.php:

php artisan vendor:publish --provider="Dipesh\LaravelLogViewer\LaravelLogViewerServiceProvider" --tag=config

Options:

  • lines_per_page (default: 200)
  • max_file_size (bytes; default: 50 MB) — skip rendering if larger
  • pattern (string or array; glob(s) like *.log,*.log.gz)
  • paths (array or comma/pipe-separated string) — multiple roots
  • storage_path (fallback when paths not set)

Security note

  • This controller reads files from storage/logs. Ensure your app's auth/authorization protects the route in production.

Notes:

  • The UI is plain HTML+CSS (no frontend framework) and lists nested paths like logs/api/access.log.
  • Very large files are skipped with a notice; adjust max_file_size as needed.

License

MIT © dipeshshihora

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-27