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: 3 months 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2026-02-02T23:24:33.000Z (5 months ago)
- Last Synced: 2026-03-28T01:30:19.587Z (3 months ago)
- Topics: logs, monolog, parser, php7
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Monolog Parser
==============

[](https://packagist.org/packages/roma-glushko/monolog-parser)
[](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