PHPackages                             mvar/log-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. mvar/log-parser

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

mvar/log-parser
===============

Universal log parser

v1.1.0(8y ago)17165.1k↓30.6%8[1 issues](https://github.com/mvar/log-parser/issues)1MITPHPPHP &gt;=5.4

Since Dec 20Pushed 7y ago2 watchersCompare

[ Source](https://github.com/mvar/log-parser)[ Packagist](https://packagist.org/packages/mvar/log-parser)[ RSS](/packages/mvar-log-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

Server Log Parser
=================

[](#server-log-parser)

[![Latest Stable Version](https://camo.githubusercontent.com/3f52e2929d093c6470acf3093e634c86ad6d27bbef0637b3ce4dc5ecbfa556bd/68747470733a2f2f706f7365722e707567782e6f72672f6d7661722f6c6f672d7061727365722f762f737461626c65)](https://packagist.org/packages/mvar/log-parser)[![Build Status](https://camo.githubusercontent.com/d4384f5c7db52ef7cf5e45914404ae56017b504af23f694276fa8b2f891b12a5/68747470733a2f2f7472617669732d63692e6f72672f6d7661722f6c6f672d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mvar/log-parser)[![Code Coverage](https://camo.githubusercontent.com/bdd3ab224605a14d026ebd2c5029d2f19b4958df0f38356d03e5479efd9a0dac/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7661722f6c6f672d7061727365722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mvar/log-parser/?branch=master)[![Code Quality](https://camo.githubusercontent.com/a519e2d97b9db22f23d50d930c4558eac87520b1c72366fc0e0b6deb9840f271/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7661722f6c6f672d7061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mvar/log-parser/?branch=master)

This library allows you to easily iterate over your Apache, nginx or any other web server log files.

Main features:

- Log file iterator
- Parser abstraction to help you implement your custom parser
- Low memory footprint even with huge files

Installation
------------

[](#installation)

This library can be found on [Packagist](https://packagist.org/packages/mvar/log-parser). The recommended way to install this is through [Composer](https://getcomposer.org):

```
composer require mvar/log-parser:^1.0
```

Basic Usage
-----------

[](#basic-usage)

Lets say you have log file `my.log` with following content:

```
GET /favicon.ico 200
GET /about 404

```

All you need to do to iterate over the file is to initialize `SimpleParser`with your regular expression and pass it to `LogIterator`:

```
