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

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

jeffreyvanrossum/wp-log
=======================

Package to allow for simple logging with interface.

0.2.3(1y ago)3139MITPHPPHP ^8.0|^8.1|^8.2

Since Mar 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jeffreyvr/wp-log)[ Packagist](https://packagist.org/packages/jeffreyvanrossum/wp-log)[ RSS](/packages/jeffreyvanrossum-wp-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

[![vanrossum.dev Logo](https://raw.githubusercontent.com/jeffreyvr/vanrossum.dev-art/main/logo.svg)](https://vanrossum.dev)

[![Total Downloads](https://camo.githubusercontent.com/46001a30247b2f156b9c87e68e3efe048fab66aa85ac4b9c3fa982e5b0777df6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a65666672657976616e726f7373756d2f77702d6c6f67)](https://packagist.org/packages/jeffreyvanrossum/wp-log)[![Latest Stable Version](https://camo.githubusercontent.com/5c42bc3b1e1fda1900e6bcec28654b8165dd945af71ce30fa5eadbc62011229c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65666672657976616e726f7373756d2f77702d6c6f67)](https://packagist.org/packages/jeffreyvanrossum/wp-log)[![License](https://camo.githubusercontent.com/8e39ed31a957579dfa9fd02f1542e4e5201a6a1e3e23d83b69b007afd555ee1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a65666672657976616e726f7373756d2f77702d6c6f67)](https://packagist.org/packages/jeffreyvanrossum/wp-log)

WP Log
======

[](#wp-log)

A simple package to write entries to a log file.

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

[](#installation)

```
composer require jeffreyvanrossum/wp-log
```

Usage
-----

[](#usage)

You can setup your log with:

```
$log = new \Jeffreyvr\WPLog\Log('Your log');
```

You can define a custom file path, if you don't, the default is the `wp-content/uploads/` folder with the file name being a sanitized version of your log name.

```
$log->setFilePath(wp_upload_dir()['basedir'] . '/logs/your-log-filename.log');
```

Writing to your log can be done like so:

```
$log->write('Your log message');

$log->write(['foo' => 'bar']);
```

You may clear your log with:

```
$log->clear();
```

The `interface` method will render an interface, which you can use to display the log somewhere in the admin area.

If you want to display the log page in the admin menu, you can call:

```
$log->interface()->inAdminMenu(slug: 'optional-slug', parent: 'tools.php');
```

To set a custom capability use:

```
$log->interface->setCapability('manage_options');
```

Or if you want to add it as a plugin link instead:

```
$log->interface()->asPluginLink(basename: plugin_basename(__FILE__), slug: 'optional-slug');
```

You can instead also call `$log->interface()->render()` to render it somewhere you want.

To prevent your log from becoming very large, the default limit is set to 1000 items. You can overwrite this:

```
$log->setClearLimit(100);

// If you don't want to limit your log, you can pass 0.
$log->setClearLimit(0);
```

Contributors
------------

[](#contributors)

- [Jeffrey van Rossum](https://github.com/jeffreyvr)
- [All contributors](https://github.com/jeffreyvr/wp-log/graphs/contributors)

License
-------

[](#license)

MIT. Please see the [License File](/LICENSE) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

5

Last Release

668d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ca71465f93459010e10f39821b541f1c00c61233c48bcda0cea8a8d6fb6988?d=identicon)[jeffreyvr](/maintainers/jeffreyvr)

---

Top Contributors

[![jeffreyvr](https://avatars.githubusercontent.com/u/9550079?v=4)](https://github.com/jeffreyvr "jeffreyvr (10 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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