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

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

moddix/wp-logger
================

Simple WP Logger

1.0.0(8mo ago)022MITPHPPHP &gt;=8.1

Since Oct 15Pushed 8mo agoCompare

[ Source](https://github.com/Moddix-Deeplay/wp-logger)[ Packagist](https://packagist.org/packages/moddix/wp-logger)[ RSS](/packages/moddix-wp-logger/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

WP Logger
=========

[](#wp-logger)

---

A simple logging library for WordPress projects using the Bedrock structure. This library allows you to log messages to a specified log file, streams and others, like in same on Monolog.

Library register `set_error_handler`, `set_exception_handler` and `register_shutdown_function` to log errors, exceptions and fatal errors.

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

[](#installation)

Install the latest version with

```
composer require moddix/wp-logger

```

Usage
-----

[](#usage)

1. Create a file in the `mu-plugins` directory of your Bedrock project (e.g., `wp-logger.php`) and include the following code:

```
use Moddix\WpLogger\Configurator;
use Moddix\WpLogger\WpLogger;
use Monolog\Handler\StreamHandler;
use Monolog\Level;
use Monolog\Formatter\JsonFormatter;

// Create a Configurator instance
$configurator = new Configurator();

// Example: Set handler to output logs to stdout in JSON format
$handler = new StreamHandler('php://stdout', Level::Debug);
$handler->setFormatter(new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES, true));

// push the handler to the configurator
$configurator->pushHandler($handler);

// Example: Add a processor to add extra data to each log record
$configurator->pushProcessor(function ($record) {
    $record->extra['dummy'] = 'Hello world!';

    return $record;
});

// Example: Add a subscriber to log wp_die events, see HookSubscribersInterface for more options
$configurator->addSubscriberClasses([
    Moddix\WpLogger\HookSubscribers\WpDieSubscriber::class,
]);

// Boot the logger with the configurator
WpLogger::boot($configurator);
```

2. Use the facade to log messages in your WordPress code:

```
\Moddix\WpLogger\Log::info('This is an info message.');
\Moddix\WpLogger\Log::warning('This is a warning message.');
\Moddix\WpLogger\Log::error('This is an error message.');

\Moddix\WpLogger\Log::debug('This is a debug message with context.', ['key' => 'value']);

\Moddix\WpLogger\Log::log('info', 'This is a log message with dynamic level.', ['key' => 'value']);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance59

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

262d ago

### Community

Maintainers

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

---

Top Contributors

[![Moddix-Deeplay](https://avatars.githubusercontent.com/u/138650566?v=4)](https://github.com/Moddix-Deeplay "Moddix-Deeplay (1 commits)")

### Embed Badge

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

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

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k203.8M358](/packages/symfony-monolog-bridge)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[illuminate/log

The Illuminate Log package.

6225.3M623](/packages/illuminate-log)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2587.9k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

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