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

Abandoned → [exolnet/wp-graylog](/?search=exolnet%2Fwp-graylog)ArchivedWordpress-plugin[Logging &amp; Monitoring](/categories/logging)

exolnet/wp-log
==============

Add Whoops and Monolog to handle Wordpress Exception

35381PHPCI passing

Since Oct 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/eXolnet/wp-log)[ Packagist](https://packagist.org/packages/exolnet/wp-log)[ RSS](/packages/exolnet-wp-log/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)DependenciesVersions (1)Used By (0)

wp-graylog
==========

[](#wp-graylog)

[![Software License](https://camo.githubusercontent.com/0e7fb06301e2a8a7aef2ece08539e06255171da1b21877d4c1a36bb45572896a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3834363961642e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/42fc6eb2c6c098f4e0acb442bca09f5b097dd19d61b526691aca8712679171e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f65586f6c6e65742f77702d677261796c6f672f74657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/eXolnet/wp-graylog/actions?query=workflow%3Atests)[![Latest Stable Version](https://camo.githubusercontent.com/01b7b6972e37e30a2e1bba1a0960ebce865240ddce2b989ed95bba5daaa6472d/68747470733a2f2f706f7365722e707567782e6f72672f65586f6c6e65742f77702d677261796c6f672f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/eXolnet/wp-graylog)[![Total Downloads](https://camo.githubusercontent.com/53c179a3fab006ba83a9dc297fe2ce6531b493fb4886ce56245b0b5f95abcd0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65586f6c6e65742f77702d677261796c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eXolnet/wp-graylog)

Adds a mu-plugin that register a Monolog handler to send exception to a Graylog channel.

Requirements
------------

[](#requirements)

- Bedrock
- Composer
- PHP 8.1 or greater
- Wordpress

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

[](#installation)

Require this package with Composer:

```
composer require exolnet/wp-graylog
```

Define the following PHP constants in your `config/application.php` file:

```
/**
 * wp-graylog
 *
 * Here you may configure the Graylog channel for your application. Behind the
 * scene, it uses the Monolog PHP logging library.
 */
Config::define('GRAYLOG_TRANSPORT', env('GRAYLOG_TRANSPORT'));
Config::define('GRAYLOG_HOST', env('GRAYLOG_HOST'));
Config::define('GRAYLOG_PORT', env('GRAYLOG_PORT'));
Config::define('GRAYLOG_LEVEL', env('GRAYLOG_LEVEL'));
```

Then, update your `.env` to add `GRAYLOG_HOST` environment variable:

```
GRAYLOG_HOST=localhost

```

Usage
-----

[](#usage)

Once installed, errors occurring in your code with a level higher or equals to the `GRAYLOG_LEVEL` will be sent to the specified Graylog instance. You’ll then be able to centralize all your logs in one place.

### Supported Transports

[](#supported-transports)

The following transports are supported: `UDP`, `TCP`, `SSL`, `HTTP` and `HTTPS`. Select the transport accordingly to your Graylog set up using the `GRAYLOG_TRANSPORT` configuration. By default, the `UDP` transport is used.

The default path for `HTTP` and `HTTPS` transports is `/gelf`. This value can be configured using the `GRAYLOG_PATH`configuration.

```
Config::define('GRAYLOG_PATH', env('GRAYLOG_PATH', '/gelf'));
```

### Application Name

[](#application-name)

By default, the blog name is used as the application name, but you can overwrite it with the variable `GRAYLOG_APP`:

```
Config::define('GRAYLOG_APP', 'custom-app-name');
```

### Disable Default Error Handler

[](#disable-default-error-handler)

By default, if a `GRAYLOG_HOST` is configured, a PHP error handler will be configured to send all errors to Graylog. This behaviour can be disabled by configuring the following environment variable:

```
Config::define('GRAYLOG_INITIALIZE_ERROR_HANDLER', false);
```

### Capturing Errors

[](#capturing-errors)

You can either capture a caught exception or capture the last error:

```
try {
    $this->functionFailsForSure();
} catch (\Throwable $exception) {
    \Exolnet\Wordpress\Graylog\WpGraylog::captureException($exception);
}

// OR

\Exolnet\Wordpress\Graylog\WpGraylog::captureLastError();
```

Testing
-------

[](#testing)

To run PHPUnit tests, please use:

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Simon Gaudreau](https://github.com/Gandhi11)
- [Alexandre D’Eschambeault](https://github.com/xel1045)
- [Patricia Gagnon-Renaud](https://github.com/pgrenaud)
- [All Contributors](../../contributors)

License
-------

[](#license)

Copyright © [eXolnet](https://www.exolnet.com). All rights reserved.

This code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). Please see the [license file](LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 72.9% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4064055?v=4)[eXolnet](/maintainers/exolnet)[@eXolnet](https://github.com/eXolnet)

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

---

Top Contributors

[![xel1045](https://avatars.githubusercontent.com/u/1497697?v=4)](https://github.com/xel1045 "xel1045 (62 commits)")[![Gandhi11](https://avatars.githubusercontent.com/u/4001049?v=4)](https://github.com/Gandhi11 "Gandhi11 (14 commits)")[![ChristopheTremblay](https://avatars.githubusercontent.com/u/61481239?v=4)](https://github.com/ChristopheTremblay "ChristopheTremblay (5 commits)")[![pgrenaud](https://avatars.githubusercontent.com/u/10713979?v=4)](https://github.com/pgrenaud "pgrenaud (4 commits)")

---

Tags

gelf-phphacktoberfestmonolog-handlerphpwordpresswordpress-plugin

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/exolnet-wp-log/health.svg)](https://phpackages.com/packages/exolnet-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)
