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

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

pls/log
=======

PLS logger specification

0.2.0(7y ago)05MITPHPPHP ^7.3

Since Aug 26Pushed 7y agoCompare

[ Source](https://github.com/PHP-library-standards/log)[ Packagist](https://packagist.org/packages/pls/log)[ Docs](https://github.com/PHP-library-standards/log)[ RSS](/packages/pls-log/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Pls/Log
=======

[](#plslog)

[![Version](https://camo.githubusercontent.com/fc2cc2e7d5a48ce2211a34e1b9222e6980dab02af84b63b9e25f22d9f6b39533/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d7072652f5048502d6c6962726172792d7374616e64617264732f6c6f672e7376673f6c6162656c3d76657273696f6e)](https://github.com/PHP-library-standards/log/releases/latest)[![semver](https://camo.githubusercontent.com/80a092585308866a22318249288bb79a8841799ea528d3dacfc53bdfb8e23ecf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73656d7665722d322e302e302d626c75652e737667)](https://semver.org/spec/v2.0.0.html)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/PHP-library-standards/log/blob/master/LICENSE)

This package describes a common interface for logging libraries. Its goal is to allow libraries to receive an object implementing `Pls\Log\Logger` and write logs to it in a simple and universal way.

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC 2119](http://tools.ietf.org/html/rfc2119).

1. Specification
----------------

[](#1-specification)

Implementations MUST implement the specified functionality entirely and MAY provide more functionality than specified.

The `Pls\Log\LoggerInterface` exposes a method, `log`, to log messages. `log` accepts three arguments: `$level`, `$message` and `$context` (optional).

### 1.1 `$level`

[](#11-level)

This is an `int` value, corresponding to one of the eight [RFC 5424](http://tools.ietf.org/html/rfc5424) severity levels.

An interface, `LogLevel`, provides constants with semantic labels mapped to the `int` severity levels. Users are RECOMMENDED to pass these constants as `$level` values.

Passing a `$level` value that is not defined by this specification, i.e. that is not &gt;= 0 and &lt;= 7, MUST throw an instance of `Pls\Log\InvalidSeverity`.

### 1.2 `$message`

[](#12-message)

This is a user-defined `string` value to log.

The message MAY contain placeholders which implementors MAY replace with values from the context array.

Placeholder names MUST correspond to keys in the context array.

Placeholder names MUST be delimited with a single opening brace `{` and a single closing brace `}`. There MUST NOT be any whitespace between the delimiters and the placeholder name.

Placeholder names MUST be composed only of the characters `A-Z`, `a-z`, `0-9`, underscore `_`, and period `.`.

Implementors MAY use placeholders to implement various escaping strategies and translate logs for display. Users SHOULD NOT pre-escape placeholder values since they can not know in which context the data will be displayed.

Passing a `$message` value that contains a malformed placeholder name MUST throw an instance of `Pls\Log\InvalidMessage`.

### 1.3 `$context`

[](#13-context)

This is an optional user-defined `array`; the default value is an empty array, `[]`. This is meant to hold any extraneous information that does not fit well in a string. The array can contain anything. A given value in the context MUST NOT throw an exception nor raise any PHP error, warning or notice.

Array keys and values MAY be of any type PHP permits and MAY be of different types within a `$context` array, except that an array key corresponding to a placeholder name must be a `string`, identical to the placeholder name in `$message`.

An array value MUST be provided for each placeholder name in `$message`. Passing a `$context` array that does not contain a key corresponding to a placeholder name which is present in the passed `$message` MUST throw an instance of `Pls\Log\InvalidContext`.

If an object implementing `\Throwable` is passed in the context data, it MUST be in the `'thrown'` key. Logging exceptions is a common pattern and this allows implementors to extract a stack trace from the exception when the log backend supports it. Implementors MUST still verify that the `'thrown'` key is actually a `\Thowable` before using it as such, as it MAY contain anything.

### 1.4 Exceptions

[](#14-exceptions)

All exceptions thrown by implementations MUST implement `Pls\Log\LoggerException`.

2. Package
----------

[](#2-package)

The interfaces are provided as part of the [pls/log](https://packagist.org/packages/pls/log) package.

Packages providing a pls/log implementation SHOULD declare that they provide `pls/log-implementation` `1.0.0`.

Projects requiring an implementation SHOULD require `pls/log-implementation` `^1.0.0`.

3. Installation
---------------

[](#3-installation)

To install with composer:

```
composer require pls/log

```

Requires PHP &gt;= 7.3.

4. License
----------

[](#4-license)

This package is released under the [MIT license](https://github.com/PHP-library-standards/log/blob/master/LICENSE).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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

Total

2

Last Release

2630d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.2.0PHP ^7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7201812?v=4)[atanvarno](/maintainers/atanvarno)[@Atanvarno](https://github.com/Atanvarno)

---

Top Contributors

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

---

Tags

logloggerPLS

### Embed Badge

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

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

###  Alternatives

[analog/analog

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

3511.6M24](/packages/analog-analog)[theorchard/monolog-cascade

Monolog extension to configure multiple loggers in the blink of an eye and access them from anywhere

1482.2M9](/packages/theorchard-monolog-cascade)[inpsyde/wonolog

Monolog-based logging package for WordPress.

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

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

402.9M79](/packages/amphp-log)[apix/log

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

521.1M20](/packages/apix-log)[mtownsend/array-redactor

A PHP package to redact array values by their keys.

146116.0k1](/packages/mtownsend-array-redactor)

PHPackages © 2026

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