mojtabaahn/laravel-web-logs
最新稳定版本:2.0.2
Composer 安装命令:
composer require mojtabaahn/laravel-web-logs
包简介
Access Laravel/Lumen logs from web made easy.
README 文档
README
View Laravel/Lumen logs in browser.
Disclaimer
This package is simply a lightweight web interface for Laravel and Lumen file-based logs. If you need an advanced debugging tool consider trying Telescope, Debugbar, Clockwork or Ray And if you need an error tracking software consider trying Sentry and Bugsnag.
Screen Shot
Installation
You can install the package via composer:
composer require mojtabaahn/laravel-web-logs
Now publish package assets using this command:
php artisan vendor:publish --tag="web-logs-assets"
Optionally, you can publish the config file of the package.
php artisan vendor:publish --provider="Mojtabaahn\LaravelWebLogs\Providers\LaravelWebLogsServiceProvider" --tag="config"
Usage
Visit the web-logs/ route use the package. You can change this in the config file.
Configuration
This is the contents of the published config file:
use Mojtabaahn\LaravelWebLogs\Http\Middlewares\Authorize; return [ /* |-------------------------------------------------------------------------- | Dashboard Enabled |-------------------------------------------------------------------------- | | Here you may specify either dashboard is enabled or not | */ 'enabled' => env('WEB_LOGS_ENABLED', true), /* |-------------------------------------------------------------------------- | Route Group Attributes |-------------------------------------------------------------------------- | | This is the array configuring package route attributes. feel free | to edit route prefixes, middlewares and anything else. | | In case you want to add authorization using default auth driver, | uncomment web middleware. | */ 'route_group_attributes' => [ 'prefix' => env('WEB_LOGS_PATH', 'web-logs'), 'middleware' => [ // 'web', Authorize::class, ], ], /* |-------------------------------------------------------------------------- | Chunk Size |-------------------------------------------------------------------------- | | On each request from dashboard to it's back-end how many logs should | it read of specified log file. Setting this option to a big number | may reduce dashboard performance! | */ 'chunk_size' => env('WEB_LOGS_CHUNK_SIZE', 10), /* |-------------------------------------------------------------------------- | Search Path |-------------------------------------------------------------------------- | | Use this property to customize logs directory where package should | look for log files. | */ 'search_path' => storage_path('logs'), ];
Authorization
Web Logs is enabled by default for all users and guests. In case you want to authorize users before accessing it you must register a viewWebLogs ability. A good place to do this is in the AuthServiceProvider that ships with Laravel.
public function boot() { $this->registerPolicies(); Gate::define('viewWebLogs', function ($user = null) { // return true if access to web logs is allowed }); }
License
The MIT License (MIT). Please see License File for more information.
mojtabaahn/laravel-web-logs 适用场景与选型建议
mojtabaahn/laravel-web-logs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.8k 次下载、GitHub Stars 达 161, 最近一次更新时间为 2021 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mojtabaahn/laravel-web-logs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mojtabaahn/laravel-web-logs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 161
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-14

