gundars / hoglog
HogLog 是为您的远程 Laravel/Lumen 安装提供的日志查看器 API
0.3.0
2015-11-20 21:00 UTC
Requires
- php: >=5.3.2
This package is not auto-updated.
Last update: 2024-09-14 17:48:14 UTC
README
,--. ,--. ____ ____ ___ ______ _____ ___ ______ \ /-~-\ / |_ || _|.' `. .' ___ ||_ _| .' `. .' ___ | )' a a `( | |__| | / .-. \/ .' \_| | | / .-. \/ .' \_| ( ,---. ) | __ | | | | || | ____ | | _ | | | || | ____ `(_o_o_)' _| | | |_\ `-' /\ `.___] |_| |__/ |\ `-' /\ `.___] | )`-'( |____||____|`.___.' `._____.'|________| `.___.' `._____.'
HogLog 是您远程 Laravel/Lumen 安装的日志文件查看器 API
###安装
将依赖项添加到您的 composer,执行
composer require gundars/hoglog ~0.3.*
将以下行添加到您的 /bootstrap/app.php
config( [ 'hoglog' => [ 'rootPrefix' => 'configuration/hoglog/', 'logdir' => storage_path() . '/logs' ] ] ); $app->register('HogLog\HogLogServiceProvider');
###备用方案 如果您的安装无法启动,但您需要一个无需 Laravel 的日志读取器,请使用 /extra/PlanB 类
格式: class::getInstance()->view(string $jailDir[, array $whitelistFilenames])
通过带有 browse
参数的文件 URL 访问它将打印文件内容,或者在目录的情况下列出条目。
####示例
#####允许读取日志目录中的所有文件 代码
\HogLog\PlanB::getInstance()->view('../storage/logs/');
URLs
#reads dir example.com/file-calling-planb.php/?browse=../storage/logs/ #reads file example.com/file-calling-planb.php/?browse=../storage/logs/lumen.log
#####允许读取存储目录中以 .txt 为扩展名的所有文件 代码
\HogLog\PlanB::getInstance()->view('../storage/', ['.txt']);
URL
example.com/file-calling-planb.php/?browse=../storage/file.txt
#####仅允许读取单个文件 lumen.log 代码
\HogLog\PlanB::getInstance()->view('../storage/logs/', ['lumen.log']);
URL
example.com/file-calling-planb.php/?browse=../storage/file.txt