composer require kriss/log-reader
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';
}
}