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

ActiveWordpress-plugin[Logging &amp; Monitoring](/categories/logging)

jitesoft/wp-logger
==================

An actual logger for WordPress.

2.0.1(11mo ago)2288MITPHPPHP &gt;=8.1

Since Aug 15Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/jitesoft/wp-logger)[ Packagist](https://packagist.org/packages/jitesoft/wp-logger)[ GitHub Sponsors](https://github.com/jitesoft)[ Fund](https://opencollective.com/jitesoft-open-source)[ RSS](/packages/jitesoft-wp-logger/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (4)Versions (8)Used By (0)

Wp-logger
=========

[](#wp-logger)

An actual logger for WordPress.
-------------------------------

[](#an-actual-logger-for-wordpress)

This plugin does two things. It piggybacks on the internal php logger (via `set_error_handler`) and it creates a PSR logger for you to use!

### More in-depth

[](#more-in-depth)

When the plugin have loaded completely in WordPress, it will fire the `jitesoft_logger_loaded` action, the callback will be passed the global logger object.
If you *know* that the plugin is loaded, you can as well use the `jitesoft('logger')` function to request the logger instance. In case it is not yet loaded, the function will return null:

```
$logger = jitesoft('logger'); // null if not lodaed
add_action('jitesoft_logger_loaded', static fn($logger) => $logger); // will not be null when loaded.
```

*Deprecation notice, the following will be removed in next major version*

It's also possible to fetch the logger through the `GlobalLogger` class through the `logger()` method:

```
Jitesoft\WordPress\Plugins\Logger\GlobalLogger;

$logger = GlobalLogger::logger();
```

### Auto-loading

[](#auto-loading)

The plugin requires auto-loading to function properly. Without the autoloader, the plugin won't be able to find the libraries it uses and hence will not create a logger.

Configuring
-----------

[](#configuring)

The plugin is currently configured via environment variables or defines. The values must be defined *before* loading the plugin, so the wp-config.php file or actual environment variables are preferable places to put those.

`WP_LOGGER_OVERRIDE` is default set to override, can be changed to `disable` to *not* override the internal php logger.

`WP_ENV` sets the default logging level on the logger:

- `production`: errors and above
- `staging`: info and above
- `development`: debug and above

In case you wish to change the logging level manually, you can set the `WP_LOGGER_LEVEL` to an appropriate level, the following are accepted: `debug`, `notice`, `info`, `warning`, `error`, `critical`, `alert`, `emergency`.

You can also change the log level by fireing the `jitesoft_log_level` hook with a single string parameter with a value of the above log levels.

### Formatting

[](#formatting)

Currently, the logger supports two default types: `json`, `stdout`.
They are possible to set with the `WP_LOGGER_FORMAT` variable (`stdout` is default).
Both of the types will output to the stdout/stderr channel (the terminal) while they will produce either clear text logs or json formatted logs.

If you wish to change the loggers on the logging object, it's possible to do so by querying the logger and add (or remove) loggers from it. Multiple loggers can be added:

```
jitesoft('logger')->removeLogger('stdout');
jitesoft('logger')->removeLogger('json');

jitesoft('logger')->addLogger(new MyPsrLogger(), 'myLogger');
```

Or directly in the hook:

```
add_action('jitesoft_logger_loaded', static function($logger) {
    $logger->removeLogger('stdout');
    $logger->removeLogger('json');
    $logger->addLogger(new MyPsrLogger(), 'myLogger');
});
```

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

[](#installation)

Use a composer based WordPress installation and require this plugin.

Loggers
-------

[](#loggers)

If you wish to add more loggers, the package depends on the [`jitesoft/loggers`](https://packagist.org/packages/jitesoft/loggers)php package, which contains multiple different loggers.
If you wish to use your own loggers, the logger must implement the [PSR-3 logger](https://www.php-fig.org/psr/psr-3/) interface.

License
-------

[](#license)

MIT!

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance50

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Recently: every ~344 days

Total

7

Last Release

358d ago

Major Versions

1.4.0 → 2.0.02025-05-24

PHP version history (2 changes)1.0.0PHP &gt;=7.4.2

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/320d3f8628cc6f5e60b96e9af6b2e4d6220426cb9723193fd50a88758ffb8f97?d=identicon)[Johannestegner](/maintainers/Johannestegner)

---

Top Contributors

[![Johannestegner](https://avatars.githubusercontent.com/u/2530181?v=4)](https://github.com/Johannestegner "Johannestegner (13 commits)")

---

Tags

hacktoberfestloggerloggingphpwordpresswordpress-plugin

### Embed Badge

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

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

###  Alternatives

[humanmade/aws-xray

HM Platform AWS X-Ray Integration

29231.9k4](/packages/humanmade-aws-xray)[jadb/cakephp-monolog

CakePHP Monolog Plugin

5518.9k](/packages/jadb-cakephp-monolog)[camspiers/silverstripe-loggerbridge

Provides a bridge between PSR-3 loggers (like monolog) and SilverStripe

1366.8k](/packages/camspiers-silverstripe-loggerbridge)[sandreu/cake-sentry

Sentry error handler plugin for CakePHP2

1640.2k](/packages/sandreu-cake-sentry)[itgalaxy/sentry-integration

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry

105.6k](/packages/itgalaxy-sentry-integration)

PHPackages © 2026

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