pulse00 / monolog-parser
A parser for monolog log entries
Installs: 303 210
Dependents: 2
Suggesters: 0
Security: 0
Stars: 45
Watchers: 4
Forks: 33
Open Issues: 8
Requires
- monolog/monolog: 1.*
Requires (Dev)
- phpunit/phpunit: ~4.5
This package is not auto-updated.
Last update: 2024-10-26 15:34:15 UTC
README
A simple library for parsing monolog logfiles.
Installation
You can install the library using composer by adding pulse00/monolog-parser
to your composer.json
.
Usage
require_once 'path/to/vendor/autoload.php'; use Dubture\Monolog\Reader\LogReader; $logFile = '/path/to/some/monolog.log'; $reader = new LogReader($logFile); foreach ($reader as $log) { echo sprintf("The log entry was written at %s. \n", $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'));