Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/virdiggg/log-parser-ci3
Log parser for default formatted log file in CodeIgniter 3
https://github.com/virdiggg/log-parser-ci3
codeigniter codeigniter-library codeigniter3 logging php
Last synced: 2 months ago
JSON representation
Log parser for default formatted log file in CodeIgniter 3
- Host: GitHub
- URL: https://github.com/virdiggg/log-parser-ci3
- Owner: virdiggg
- License: mit
- Created: 2024-11-13T15:41:06.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-13T15:44:14.000Z (2 months ago)
- Last Synced: 2024-11-13T16:37:28.968Z (2 months ago)
- Topics: codeigniter, codeigniter-library, codeigniter3, logging, php
- Language: PHP
- Homepage:
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Simple Log Parser for CodeIgniter 3
## Inspired from [opcodesio/log-viewer](https://github.com/opcodesio/log-viewer) for laravel.
### HOW TO USE
- Install this library with composer
```bash
composer require virdiggg/log-parser-ci3
```
- Open your `config/config.php`, then edit this line.
```diff
-$config['log_threshold'] = 0;
+$config['log_threshold'] = 1;
```
- Optional, you can use `.log` extension, not the default `.php`. Edit this line.
```diff
-$config['log_file_extension'] = '';
+$config['log_file_extension'] = 'log';
```
- Create a controller to use this library. Example is `application/controller/App.php`. This example is in JSON format; you can modify it accordingly.
```php
logs = new MYViewer();
}public function logs()
{
// Log path
$this->logs->setPath(APPPATH . 'logs');
// Log extension
$this->logs->setExt('php');$filterDate = $this->input->post('date') ? $this->input->post('date') : '2023-01-01';
$this->logs->setName('log-' . $filterDate);
$result = $this->logs->getLogs();
echo json_encode($result);
return;
}
}
```
- Open your website.
```
http://localhost/codeigniter/app/logs
```