PHPackages                             withaspark/log-aggregator - 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. withaspark/log-aggregator

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

withaspark/log-aggregator
=========================

A simple utility for aggregating, searching, and tailing remote log files.

v0.1.0(6y ago)03MITPHP

Since Aug 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/withaspark/LogAggregator)[ Packagist](https://packagist.org/packages/withaspark/log-aggregator)[ RSS](/packages/withaspark-log-aggregator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

withaspark/LogAggregator
========================

[](#withasparklogaggregator)

Install
-------

[](#install)

1. Install package. ```
    composer require withaspark/log-aggregator
    ```
2. Define your configuration of hosts, logging groups, and log files. ```
    cp config.example.json config.json
    ```

    Then edit the entries.
3. Setup ssh public keys.

Usage
-----

[](#usage)

### CLI

[](#cli)

#### To build index

[](#to-build-index)

The `pull` command fetches all log files configured to be watched and builds a master log index containing all records.

**NOTE:** Deduplication is in place to eliminate duplicate records being indexed with each run, but will also eliminate identical log messages that occurred on the same host, log file, and with the same timestamp (if present).

To run,

```
path/to/pull
```

For example,

```
./pull logs
```

#### To query index

[](#to-query-index)

The `query` command will search the master log index for all records matching. Simple search terms like "Page not found" as well as regular expressions are supported.

Each log message returned from the index will contain the hostname and log file name prepended to the line. This allows filtering by hostname and log file name in addition to the search pattern.

To run,

```
path/to/search ""
```

For example,

```
./search "host\.example\.com.*auth\.log.*Failed password"
```

#### To parse and store in local SQLite database

[](#to-parse-and-store-in-local-sqlite-database)

The `analyze` command parses the master log index and stores messages to a local SQLite database for easier integration for other use-cases and extensions.

**NOTE:** This feature requires the PHP pdo-sqlite extension be installed.

The database and tables will automatically be created, as needed, and saved to `./database/database.sqlite`.

Log messages are saved to the `logs` table. Available columns include:

NameDatatypeDescription`id``INTEGER AUTOINCREMENT`Unique ID of the row. For future use.`hash``TEXT`The SHA-1 hash of the original log message. Used for deduplication.`host``TEXT`The full hostname used to make the connection to the host when pulling the logs.`file``TEXT`The name of the log file the message was found in.`message``TEXT`The full log message.`created_at``DATETIME`The datetime the message was first seen by the `analyze` command.To run,

```
path/to/analyze
```

For example,

```
./analyze
```

#### To tail logs

[](#to-tail-logs)

The `tail` command can be used to simultaneously tail all of the configured remote logs.

To run,

```
path/to/tail
```

For example,

```
./tail
```

Send SIGINT ``+`c` to exit.

Roadmap
-------

[](#roadmap)

- Accept config file as commandline argument. This would allow separate config files for different scenarios and commands. In lieu of this feature, we may add support for a command-line option to scope by host, log group, and/or log file.
- Config file validation to minimize unhelpful error messages.
- Handle losses of connectivity to remote hosts.
- Add default log groups that require only hosts, e.g., syslog, apache, nginx, etc.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~1 days

Total

2

Last Release

2456d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08ca31e94813e35a5b6d347105ac6f7d16a9fae5baeb3dd2697eee6e9381ac1d?d=identicon)[withaspark](/maintainers/withaspark)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/withaspark-log-aggregator/health.svg)

```
[![Health](https://phpackages.com/badges/withaspark-log-aggregator/health.svg)](https://phpackages.com/packages/withaspark-log-aggregator)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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