Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roma-glushko/monolog-parser
🛠Parser for your monolog records
https://github.com/roma-glushko/monolog-parser
logs monolog parser php7
Last synced: about 1 month ago
JSON representation
🛠Parser for your monolog records
- Host: GitHub
- URL: https://github.com/roma-glushko/monolog-parser
- Owner: roma-glushko
- License: mit
- Created: 2020-03-28T19:44:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T16:19:18.000Z (over 4 years ago)
- Last Synced: 2024-10-09T19:34:34.526Z (about 1 month ago)
- Topics: logs, monolog, parser, php7
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Monolog Parser
==============![](https://github.com/roma-glushko/monolog-parser/workflows/CI/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/roma-glushko/monolog-parser/v/stable)](https://packagist.org/packages/roma-glushko/monolog-parser)
[![License](https://poser.pugx.org/roma-glushko/monolog-parser/license)](https://packagist.org/packages/roma-glushko/monolog-parser)A package for parsing [monolog](https://github.com/Seldaek/monolog) records including multiline support.
## Installation
```bash
composer require roma-glushko/monolog-parser
```## Usage
```php
require_once 'path/to/vendor/autoload.php';
use MonologParser\Reader\LogReader;
$logFile = '/path/to/some/monolog.log';
$reader = new LogReader($logFile);
foreach ($reader as $i => $log) {
echo sprintf(
"The #%s log entry was written at %s. \n",
$i,
$log['date']->format('Y-m-d h:i:s')
);
}
$lastLine = $reader[count($reader)-1];
echo sprintf(
"The last log entry was written at %s. \n",
$lastLine['date']->format('Y-m-d h:i:s')
);```
## Credits
This project is derived from [pulse00/monolog-parser](https://github.com/pulse00/monolog-parser) which is pretty cool but seems to be not actively supported and misses record mulitline support