Gundars / HogLog by gundars

HogLog is a log viewer API for your remote Laravel/Lumen installation
1,088
1
2
Package Data
Maintainer Username: gundars
Maintainer Contact: me@gundars.me (Gundars Mēness)
Package Create Date: 2015-06-20
Package Last Update: 2015-11-20
Language: PHP
License: MIT
Last Refreshed: 2024-12-18 03:05:30
Package Statistics
Total Downloads: 1,088
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0


    ,--.   ,--.     ____  ____   ___      ______  _____       ___      ______
    \  /-~-\  /    |_   ||   _|.'   `.  .' ___  ||_   _|    .'   `.  .' ___  |
     )' a a `(       | |__| | /  .-.  \/ .'   \_|  | |     /  .-.  \/ .'   \_|
    (  ,---.  )      |  __  | | |   | || |   ____  | |   _ | |   | || |   ____
     `(_o_o_)'      _| |  | |_\  `-'  /\ `.___]  |_| |__/ |\  `-'  /\ `.___]  |
       )`-'(       |____||____|`.___.'  `._____.'|________| `.___.'  `._____.'



HogLog is log file viewer API for your remote Laravel/Lumen installation

###Installation

Add a dependency to your composer, execute

composer require gundars/hoglog ~0.3.*

Add the following lines to your /bootstrap/app.php:

config(
    [
        'hoglog' => [
            'rootPrefix' => 'configuration/hoglog/',
            'logdir'     => storage_path() . '/logs'
        ]
    ]
);
$app->register('HogLog\HogLogServiceProvider');

###Plan B If your installation is not booting, but you need laravel-less log reader, use the /extra/PlanB class

Format: class::getInstance()->view(string $jailDir[, array $whitelistFilenames])

Hitting the URL of the file it is included in with browse parameter will either print the file contents, or list of items in case of a directory.

####Samples:

#####Allow reading all files in logs directory Code:

\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

#####Allow reading all files in storage directory with .txt extension Code:

\HogLog\PlanB::getInstance()->view('../storage/', ['.txt']);

URL:

example.com/file-calling-planb.php/?browse=../storage/file.txt

#####Allow reading only single file lumen.log Code:

\HogLog\PlanB::getInstance()->view('../storage/logs/', ['lumen.log']);

URL:

example.com/file-calling-planb.php/?browse=../storage/file.txt