PHPackages                             tdsereno/httpd-analyzer - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tdsereno/httpd-analyzer

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tdsereno/httpd-analyzer
=======================

Analise de logs apache httpd

20[6 issues](https://github.com/tdsereno/httpd-analyzer/issues)Roff

Since Jul 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tdsereno/httpd-analyzer)[ Packagist](https://packagist.org/packages/tdsereno/httpd-analyzer)[ RSS](/packages/tdsereno-httpd-analyzer/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Apache2/Httpd Log Analyzer - PHP
================================

[](#apache2httpd-log-analyzer---php)

A tool to analyze logs from an apache web server, with one or more domains and multiple log formats. Example output: [![](https://github.com/tdsereno/httpd-analyzer/raw/main/result_example.png)](https://github.com/tdsereno/httpd-analyzer/blob/main/result_example.png)

Requirements
------------

[](#requirements)

- PHP 7.3.0 or newer

Getting started
---------------

[](#getting-started)

Download it standalone and install depedencies

```
git clone https://github.com/tdsereno/httpd-analyzer.git
cd httpd-analyzer
composer install --ignore-platform-reqs
php -f apache.php

```

Or, install via [Composer](https://getcomposer.org/):

```
composer require tdsereno/httpd-analyzer

```

All start in instance the analyzer, like this:

```
$analyzer = new \Tdsereno\HttpdAnalyzer\Analyzer();

```

So, you can add log files, like this:

```
$analyzer->addFile(__DIR__ . '/logs/no_domain_acess.log');

```

Add a folder:

```
  foreach (glob(__DIR__ . '/logs/*.{*}', GLOB_BRACE) as $filename)
  {
      $analyzer->addFile($filename);
  }

```

Set the max depth for show results:

```
$analyzer->setMaxDepth(40);

```

So, after add the logs, you can proccess all files:

```
$analyzer->load();

```

Output this in terminal:

```
$analyzer->print();

```

Get the object and made yourself analityc, its return a array of Model\\Httpd\\LogGroup

```
$result = $analizer->getLogGroup();

```

Output to txt

```
php -f apache.php > file.txt

```

Filter a domain or a log file (if dont use the canonical Server name in log)

```
$analizer->setFilter('www.mydomain.com.br');
$analizer->setFilter('mydomain_access.log');

```

Filter a date period

```
$analizer->setMinDate('24/Jun/2022:23:30:00 -0300');
$analizer->setMaxDate('24/Jun/2022:23:59:00 -0300');

```

Log Format
----------

[](#log-format)

In case of servers that host more than one domain, it is natural to want to analyze the accesses, individually, by default, according to the [httpd documentation](https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#examples), the default log format is:

Default Log Format - Common Log Format (CLF)

```
"%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\""

```

My suggestion: (Have the The canonical ServerName of the server serving the request)

```
"%v %h %l %u %t  \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""

```

In cent os, the conf file is loccated in:

```
/etc/httpd/conf/httpd.conf

```

On ubuntu is:

```
/etc/apache2/apache2.conf

```

If you don't wanna change the log format, you can separete each ServerName im a log file

Perfomance
----------

[](#perfomance)

I tested with more than real 50 log files, in size of 3.7Gb

In a digital ocean droplet, with 1 VCPU Shared, 1GB RAM and SSD (using SWAP) - 8179 lines per seconds

```
Processed 57 files with size of 3740.6MB In a total of 12412537 lines with success on 12412537 lines in 1517 seconds about 8179 lines per seconds

```

In a digital ocean droplet, with 2 VCPU Decidated, 8GB RAM and SSD - 47784 lines per seconds

```
Processed 57 files with size of 3740.6MB In a total of 12412537 lines with success on 12412537 lines in 259 seconds about 47784 lines per seconds

```

###  Health Score

9

—

LowBetter than 0% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2a95cdcb11dc8dc3516891bf0cdb476632fdabf792992355c5464981c73f477?d=identicon)[tdsereno](/maintainers/tdsereno)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tdsereno-httpd-analyzer/health.svg)

```
[![Health](https://phpackages.com/badges/tdsereno-httpd-analyzer/health.svg)](https://phpackages.com/packages/tdsereno-httpd-analyzer)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.4k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M273](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M337](/packages/open-telemetry-sdk)

PHPackages © 2026

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