PHPackages                             timefrontiers/php-error-log - 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. timefrontiers/php-error-log

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

timefrontiers/php-error-log
===========================

PHP Error Log writer and reader with pagination

v1.0.0(1mo ago)019MITPHPPHP &gt;=8.1

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/timefrontiers/php-error-log)[ Packagist](https://packagist.org/packages/timefrontiers/php-error-log)[ Docs](https://github.com/timefrontiers/php-error-log)[ RSS](/packages/timefrontiers-php-error-log/feed)WikiDiscussions master Synced 1w ago

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

TimeFrontiers PHP Error Log
===========================

[](#timefrontiers-php-error-log)

A lightweight PHP logging utility that writes structured error entries and reads them back with pagination support.

[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Features
--------

[](#features)

- **Structured log format** using custom delimiters for easy parsing.
- **Pagination** when reading large log files.
- **Status code prefixes** following TimeFrontiers API response pattern.
- **Zero dependencies** – only requires PHP 8.1+.
- **PSR‑4 autoloading**.

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

[](#installation)

```
composer require timefrontiers/php-error-log
```

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

[](#requirements)

- PHP 8.1 or higher

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

[](#basic-usage)

### Writing Logs

[](#writing-logs)

```
use TimeFrontiers\ErrorLog;
use TimeFrontiers\ResponseStatus;

$log = new ErrorLog(
  base_dir: '/var/www/project',
  process_name: 'api',
  is_error_log: true
);

$log->write(
  ResponseStatus::UNKNOWN_ERROR,
  'Request failed.',
  ['Failed to populate order-items', 'SQL syntax error near ...']
);
```

### Reading Logs

[](#reading-logs)

```
$log = new ErrorLog();

// Read first page
$entries = $log->read('/path/to/logfile.log', 1, 25);

// Navigate pages
while ($log->hasNextPage()) {
  $next_page = $log->getNextPage();
  $entries = $log->read(null, $next_page, 25);
  // Process entries...
}

echo "Total pages: " . $log->getTotalPages();
```

### ResponseStatus Enum

[](#responsestatus-enum)

The package includes a `ResponseStatus` enum for consistent status codes:

CaseValueDescription`NO_ERROR`0.0Process completed successfully`NO_TASK`0.1No action was taken`NO_DATA`0.2No data found`ACCESS_ERROR`1.Permission/access error`INPUT_ERROR`2.Validation/malformed input error`PROCESS_ERROR`3.System cannot process at this time`UNKNOWN_ERROR`4.Uncategorized error`THIRD_PARTY_ERROR`5.Third‑party API/gateway errorThe decimal part (`.x`) is automatically appended based on the number of error strings provided.

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

[](#log-format)

Each entry is a single line:

```
Date:>2024-05-31 00:46:25/>Status:>4.2/>Message:>Request failed./>Errors:>First error\>Second error

```

- Segments separated by `/>`
- Key‑value pairs use `:>`
- Multiple errors separated by `\>`

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

```

---

```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

56d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

logphploggingpaginationerror

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timefrontiers-php-error-log/health.svg)

```
[![Health](https://phpackages.com/badges/timefrontiers-php-error-log/health.svg)](https://phpackages.com/packages/timefrontiers-php-error-log)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3511.6M24](/packages/analog-analog)[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1363.6M11](/packages/hedii-laravel-gelf-logger)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

26927.9k](/packages/saasscaleup-laravel-log-alarm)[logtail/monolog-logtail

Logtail handler for Monolog

233.5M3](/packages/logtail-monolog-logtail)[e2ex/e2ex

Converts PHP Errors to Exceptions and (optionally) logs PHP Errors, Notices and Warnings with a PSR-3 compatible logger

101.5k](/packages/e2ex-e2ex)

PHPackages © 2026

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