PHPackages                             joefallon/phplog - 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. joefallon/phplog

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

joefallon/phplog
================

This package contains simple PSR logger that minimizes line length.

v3.1.2(10y ago)096MITPHPPHP &gt;=5.3.0

Since Jul 18Pushed 10y ago1 watchersCompare

[ Source](https://github.com/joefallon/phplog)[ Packagist](https://packagist.org/packages/joefallon/phplog)[ Docs](https://github.com/joefallon/phplog)[ RSS](/packages/joefallon-phplog/feed)WikiDiscussions master Synced 5d ago

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

phplog
======

[](#phplog)

By [Joe Fallon](http://blog.joefallon.net)

A simple logging library. It has the following features:

- Full suite of unit tests.
- It can be integrated into any existing project.
- Can be fully understood in just a few moments.
- Each line of log text contains minimal prefix cruft.
- Fully [psr/log](https://github.com/php-fig/log) compliant.

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

[](#installation)

The easiest way to install PhpDatabase is with [Composer](https://getcomposer.org/). Create the following `composer.json` file and run the `php composer.phar install` command to install it.

```
{
    "require": {
        "joefallon/phplog": "*"
    }
}
```

Usage
-----

[](#usage)

There is one class contained in this library called `Log`. It contains the following methods:

```
__construct($filePath, $level)
emergency($message, array $context = array())
alert($message, array $context = array())
critical($message, array $context = array())
error($message, array $context = array())
warning($message, array $context = array())
notice($message, array $context = array())
info($message, array $context = array())
debug($message, array $context = array())
log($level, $message, array $context = array())
```

Example log entrys with contexts looks like this:

```
2015-02-05 10:35:20 [DEBUG] Test debug. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [INFO] Test info. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [LOG] Test notice. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [WARN] Test warning. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ERROR] Test error. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [CRITICAL] Test critical. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ALERT] Test alert. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [EMERGENCY] Test emergency. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ALERT] Test off message. {"contextKey":"contextVal"}

```

Example log entrys without contexts looks like this:

```
2015-02-05 10:35:20 [DEBUG] Test debug.
2015-02-05 10:35:20 [INFO] Test info.
2015-02-05 10:35:20 [LOG] Test notice.
2015-02-05 10:35:20 [WARN] Test warning.
2015-02-05 10:35:20 [ERROR] Test error.
2015-02-05 10:35:20 [CRITICAL] Test critical.
2015-02-05 10:35:20 [ALERT] Test alert.
2015-02-05 10:35:20 [EMERGENCY] Test emergency.
2015-02-05 10:35:20 [ALERT] Test off message.

```

### Open Log and Write a Debug Message

[](#open-log-and-write-a-debug-message)

```
$logger = new Log('/tests/logs/' . date('Y-m-d') . '.log', Log::DEBUG);
$logger->debug('Test debug.', array('contextKey' => 'contextVal'));
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~107 days

Total

10

Last Release

3792d ago

Major Versions

v1.0.3 → v2.0.02014-10-20

v2.0.1 → v3.0.02014-10-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/97cecfa80ffec8e9e7b5d0ff6df026b636e31a15fe0c2155baba402b5d4f0819?d=identicon)[joefallon](/maintainers/joefallon)

---

Top Contributors

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

---

Tags

loglogger

### Embed Badge

![Health badge](/badges/joefallon-phplog/health.svg)

```
[![Health](https://phpackages.com/badges/joefallon-phplog/health.svg)](https://phpackages.com/packages/joefallon-phplog)
```

###  Alternatives

[analog/analog

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

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[amphp/log

Non-blocking logging for PHP based on Amp, Revolt, and Monolog.

402.6M70](/packages/amphp-log)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)[wa72/simplelogger

Wa72SimpleLogger is a collection of very simple loggers implementing \\Psr\\Log\\LoggerInterface (PSR-3)

13246.6k13](/packages/wa72-simplelogger)

PHPackages © 2026

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