kriss / log-reader
Log Reader For PHP
Installs: 2 183
Dependents: 3
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >7.0
- nesbot/carbon: >=1.0
- symfony/finder: >=3.0
- symfony/http-foundation: >=3.0
README
Installation
composer require kriss/log-reader
Usage
Use LogReaderControllerTrait in controller
use Kriss\LogReader\Traits\LogReaderControllerTrait; use Kriss\LogReader\LogReader; class SomeController { use LogReaderControllerTrait; private $logReader; protected function getLogReader(): LogReader { if (!$this->logReader) { //$runtimePath = __DIR__ . '/../runtime/logs'; $this->logReader = new LogReader($runtimePath, [ 'enable' => true, 'deleteEnable' => true, // others ]); } return $this->logReader; } protected function getRequest(): SymfonyRequest { return request()->getSymfonyRequest(); } protected function getBaseUrl(): string { return 'some/url-prefix'; } }