PHPackages                             phpnomad/logger - 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. phpnomad/logger

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

phpnomad/logger
===============

1.2.1(3w ago)06.3k↓34.2%[2 PRs](https://github.com/phpnomad/logger/pulls)7MITPHPCI passing

Since Oct 31Pushed 2w ago2 watchersCompare

[ Source](https://github.com/phpnomad/logger)[ Packagist](https://packagist.org/packages/phpnomad/logger)[ Docs](https://github.com/phpnomad/core)[ RSS](/packages/phpnomad-logger/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (12)Versions (12)Used By (7)

phpnomad/logger
===============

[](#phpnomadlogger)

[![Latest Version](https://camo.githubusercontent.com/3c502f26dea41c064a401322463b34041a805bfd665b1c70fad117b48e0ef516/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f6c6f676765722e737667)](https://packagist.org/packages/phpnomad/logger)[![Total Downloads](https://camo.githubusercontent.com/7c7eb5a79cedd3d688bfd3ad8d7d8ab764cc57dcef5a5abcafc41b259e4f0248/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f6c6f676765722e737667)](https://packagist.org/packages/phpnomad/logger)[![PHP Version](https://camo.githubusercontent.com/8590129a8de9040869cfc05e2f677549449deada4df5bf387e143b914677a37d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f6c6f676765722e737667)](https://packagist.org/packages/phpnomad/logger)[![License](https://camo.githubusercontent.com/77579db93b4237e08fd09cdc2af5b8aa78baa1d9add1990e409003271fcc99b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f6c6f676765722e737667)](https://packagist.org/packages/phpnomad/logger)

`phpnomad/logger` defines the logging contract used throughout PHPNomad applications. It ships the `LoggerStrategy` interface, the `CanLogException` trait, and the `LoggerLevel` constants, and nothing else. Implementations live in other packages or in your own application code, so you can swap logging destinations without touching the code that calls the logger.

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

[](#installation)

```
composer require phpnomad/logger
```

Overview
--------

[](#overview)

The package provides a small, focused set of building blocks:

- `LoggerStrategy` interface with eight level methods (`emergency`, `alert`, `critical`, `error`, `warning`, `notice`, `info`, `debug`) plus `logException` for structured exception logging.
- `CanLogException` trait that implements `logException` by attaching the exception to context and dispatching to the configured level method (defaults to `critical`).
- `LoggerLevel` constants for the eight level strings, matching PSR-3 conventions.
- Zero runtime dependencies. The package is pure abstraction.
- Pairs with `phpnomad/core`, which ships an event-broadcasting strategy and a static `Logger` facade. Transports like `phpnomad/sentry-integration` subscribe to those events in production builds.

Usage
-----

[](#usage)

Inject `LoggerStrategy` and call the appropriate level:

```
use PHPNomad\Logger\Interfaces\LoggerStrategy;

class OrderService
{
    public function __construct(private LoggerStrategy $logger) {}

    public function process(Order $order): void
    {
        $this->logger->info('Processing order', ['order_id' => $order->getId()]);
    }
}
```

Documentation
-------------

[](#documentation)

Full documentation for the logger package and the rest of PHPNomad lives at [phpnomad.com](https://phpnomad.com).

License
-------

[](#license)

MIT. See [LICENSE.txt](LICENSE.txt).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance96

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~180 days

Total

4

Last Release

21d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (18 commits)")[![malayladu](https://avatars.githubusercontent.com/u/708174?v=4)](https://github.com/malayladu "malayladu (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

frameworkloggerloggingphpphpnomadplatform-agnosticpsr-3

### Embed Badge

![Health badge](/badges/phpnomad-logger/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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