Download the PHP package arraypress/wp-logger without Composer
On this page you can find all versions of the php package arraypress/wp-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arraypress/wp-logger
More information about arraypress/wp-logger
Files in arraypress/wp-logger
Package wp-logger
Short Description A simple, lean logging library for WordPress plugins and themes with registry pattern support.
License GPL-2.0-or-later
Homepage https://github.com/arraypress/wp-logger/
Informations about the package wp-logger
WordPress Logger
A debug log per plugin, in a file nobody can find by guessing.
What it does
error_log() puts everything from every plugin in one file, which is useless
the moment two things are misbehaving. The usual fix is a per-plugin log in
uploads — but a predictable path means a public URL, and that file holds
customer emails, IP addresses and gateway responses.
The filename carries a hash of the plugin name derived from the site's own
salts, so it cannot be guessed from outside. That matters because the
.htaccess written alongside it does nothing on nginx.
Features
- One log per plugin, at a path that cannot be guessed
- Levels for error, warning, info and debug
- Log a
Throwablewith its file, line and trace, or aWP_Errorwith its code - Attach structured context to any entry, stored as JSON
- Rotates at a size limit, keeping one previous generation, so a forgotten debug flag cannot fill the disk
- Off unless
WP_DEBUGor your own{PLUGIN}_DEBUGconstant says otherwise - Registry, so anything in the plugin can reach the same logger
Installation
Quick start
Logging is off unless WP_DEBUG is on, or you define SUGARCART_DEBUG.
Requirements
- PHP 8.3 or later
- WordPress 7.1 or later
License
GPL-2.0-or-later