PHPackages                             theodorejb/iis-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. theodorejb/iis-log-parser

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

theodorejb/iis-log-parser
=========================

Parse IIS log files

v1.0.1(2y ago)03.4k↓50%MITPHPPHP &gt;=8.1CI passing

Since May 5Pushed 8mo ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (3)Used By (0)

IIS Log Parser
==============

[](#iis-log-parser)

This package makes it easy to parse IIS log files using PHP. Supports the standard W3C log file format with default fields as well as the optional Host field.

Install via Composer
--------------------

[](#install-via-composer)

`composer require theodorejb/iis-log-parser`

Usage
-----

[](#usage)

Construct an `SplFileObject` instance for the IIS log file to be parsed. Then call the `IISLogFile::getEntries` static method, passing it the `SplFileObject`. This returns a generator which yields an `IISLogEntry` object for each entry in the file.

Code example which iterates over the entries of all log files in a directory:

```
use theodorejb\IISLogParser\IISLogFile;

$directory = new \FilesystemIterator('C:/inetpub/logs/LogFiles/W3SVC1');

while ($directory->valid()) {
    $current = $directory->current();
    echo "Processing {$current->getFilename()}\n";

    $entries = IISLogFile::getEntries($current->openFile());

    foreach ($entries as $entry) {
        echo "Request to {$entry->uri} occurred on {$entry->date->format(DATE_ATOM)}\n";
    }

    echo "\n";
    $directory->next();
}
```

The `IISLogEntry` class has the following public properties:

- `DateTimeImmutable $date`
- `string $serverIP`
- `string $method`
- `string $uri`
- `string $query`
- `int $serverPort`
- `string $username`
- `string $clientIP`
- `string $useragent`
- `string $referer`
- `string $host`
- `int $statusCode`
- `int $subStatusCode`
- `int $win32StatusCode`
- `int $timeTakenMs`

It also has a public `getUriExtension()` method.

Required fields
---------------

[](#required-fields)

Only the Date and Time logging fields (used for the `$date` property) are required. Other properties will be set to a blank string (or 0, for int properties) if the associated logging field is absent.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance45

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~138 days

Total

2

Last Release

960d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3053271?v=4)[Theodore Brown](/maintainers/theodorejb)[@theodorejb](https://github.com/theodorejb)

---

Top Contributors

[![theodorejb](https://avatars.githubusercontent.com/u/3053271?v=4)](https://github.com/theodorejb "theodorejb (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/theodorejb-iis-log-parser/health.svg)

```
[![Health](https://phpackages.com/badges/theodorejb-iis-log-parser/health.svg)](https://phpackages.com/packages/theodorejb-iis-log-parser)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M282](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M343](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
