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

ActiveLibrary

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

Simple WP Logger

1.0.0(7mo ago)016MITPHPPHP &gt;=8.1

Since Oct 15Pushed 7mo 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 1mo ago

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

32

—

LowBetter than 72% of packages

Maintenance64

Regular maintenance activity

Popularity7

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

215d 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

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[drevops/git-artifact

Package artifact from your codebase in CI and push it to a separate git repo.

2133.2k](/packages/drevops-git-artifact)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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