https://github.com/krissss/php-log-reader
Log Reader For PHP
https://github.com/krissss/php-log-reader
log-reader php
Last synced: about 2 months ago
JSON representation
Log Reader For PHP
- Host: GitHub
- URL: https://github.com/krissss/php-log-reader
- Owner: krissss
- Created: 2021-09-26T09:29:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-05T07:31:31.000Z (4 months ago)
- Last Synced: 2025-03-19T22:50:06.740Z (2 months ago)
- Topics: log-reader, php
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Log Reader For PHP

# Installation
```bash
composer require kriss/log-reader
```# Usage
## Use LogReaderControllerTrait in controller
```php
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';
}
}
```# For Laravel
[see example](./example/laravel)