jkh / apache-log-parser-library
apache parser library
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/jkh/apache-log-parser-library
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2026-01-04 11:26:33 UTC
README
Install
Using composer:
composer require jkh/apache-log-parser-library
Usage
Simply instantiate the class :
$parser = new \jkh\ApacheLogParser\ApacheLogParser();
And then parse the lines of your access log file :
$log_file = '/var/log/apache2/access.log'; $handle = fopen($log_file, "r"); if ($handle) { while (($line = fgets($handle)) !== false) { $entry = $parser->parse($line); } fclose($handle); } else { echo "An error occurred: unable to open the file!\n"; }
Where $entry object will hold all data parsed.