PHPackages                             tintonic/php-elog - 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. tintonic/php-elog

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

tintonic/php-elog
=================

Simple PHP class for enhanced error logging

v1.0.5(2mo ago)01.3kMITPHP

Since Jan 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/thomasisberg/php-elog)[ Packagist](https://packagist.org/packages/tintonic/php-elog)[ RSS](/packages/tintonic-php-elog/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

php-elog
========

[](#php-elog)

Simple PHP solution for enhanced logging.

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

[](#installation)

```
composer require tintonic/php-elog
```

Usage
-----

[](#usage)

### Simple usage – create instance and log via helpers

[](#simple-usage--create-instance-and-log-via-helpers)

This example creates an `Elog` instance that will log to a file named `elog.log` in the same directory as executing script (`__DIR__`). The helper function `elog()` logs to the instance of `Elog` that was first created.

```
create_elog();

/*
Logs to the first instance that was created.
Logs to "__DIR__/elog.log"
*/
elog("I am elog.log");
```

### Logging different data types

[](#logging-different-data-types)

- `null` is presented as `[null]`
- `empty string` is presented as `[empty string]`
- `true` is presented as `[true]`
- `false` is presented as `[false]`
- `object` and `array` is described using `print_r()`

```
create_elog();

elog(null);  // [null]

elog('');    // [empty string]

elog(true);  // [true]

elog(false); // [false]

elog((object) [
    'id' => 123,
    'foo' => 'bar'
]);

/*
stdClass Object
(
    [id] => 123
    [foo] => bar
)
*/

elog([
    'id' => 123,
    'foo' => 'bar'
]);

/*
Array
(
    [id] => 123
    [foo] => bar
)
*/
```

### Include label and / or data type

[](#include-label-and--or-data-type)

```
elog(123, 'Current value', true);

/*
--- Current value {integer} ---
123
*/
```

### Named instances

[](#named-instances)

This example creates two named `Elog` instances – one that logs to `_DIR__/first.log` and another that logs to `/path/to/log/second_log_file` (without file extension).

```
create_elog(__DIR__, 'first');
create_elog('/path/to/log', 'second', 'second_log_file', null);

// Log to named instances using elogn().
elogn('first', "I am first.log");         //  ———>  __DIR__/first.log
elogn('second', "I am second_log_file");  //  ———>  /path/to/log/second_log_file
```

### Using the Elog class

[](#using-the-elog-class)

Of course you may use the `Elog` class directly.

This example also demonstrates how you can configure a default value for `$include_type` to always include the data type in the output.

```
use Tintonic/PhpElog/Elog;

/*
Create an instance named "notes" that logs to "/path/to/log/elog.txt" with data type by default.
*/
$logger = new Elog('/path/to/log', 'notes', 'elog', 'txt');
$logger->set_default_include_type(true);

/*
Log to named instance somewhere else in the application.
*/
Elog::logn('notes', 123);

/*
{integer}
123
*/

Elog::logn('notes' 'bar', 'Foo?');

/*
--- Foo? {string} ---
bar
*/
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance86

Actively maintained with recent releases

Popularity17

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

Recently: every ~378 days

Total

8

Last Release

66d ago

Major Versions

v0.0.2 → v1.0.02022-01-21

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tintonic-php-elog/health.svg)

```
[![Health](https://phpackages.com/badges/tintonic-php-elog/health.svg)](https://phpackages.com/packages/tintonic-php-elog)
```

###  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)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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