Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/inpsyde/Wonolog

Monolog-based logging package for WordPress.
https://github.com/inpsyde/Wonolog

debugging hacktoberfest logging monolog php psr-3 wordpress

Last synced: 9 days ago
JSON representation

Monolog-based logging package for WordPress.

Awesome Lists containing this project

README

        

# Wonolog

[![Version](https://img.shields.io/packagist/v/inpsyde/wonolog.svg)](https://packagist.org/packages/inpsyde/wonolog)
[![Status](https://img.shields.io/badge/status-active-brightgreen.svg)](https://github.com/inpsyde/Wonolog)
[![Build](https://img.shields.io/travis/inpsyde/Wonolog.svg)](http://travis-ci.org/inpsyde/Wonolog)
[![Downloads](https://img.shields.io/packagist/dt/inpsyde/wonolog.svg)](https://packagist.org/packages/inpsyde/wonolog)
[![License](https://img.shields.io/packagist/l/inpsyde/wonolog.svg)](https://packagist.org/packages/inpsyde/wonolog)

![Wonolog](assets/images/banner.png)

> Monolog-based logging package for WordPress.

------

## Table of Contents

- [Introduction](#introduction)
- [Minimum Requirements and Dependencies](#minimum-requirements-and-dependencies)
- [Getting Started](#getting-started)
- [Wonolog Defaults](#wonolog-defaults)
- [Learn More](#learn-more)
- [License and Copyright](#license-and-copyright)

------

## Introduction

Wonolog is a Composer package (not a plugin) that allows to log anything that *happens* in a WordPress site.

It is based on [Monolog](https://github.com/Seldaek/monolog), which, with its over 38 millions of downloads and thousands of dependent packages, is the most popular logging library for PHP, compatible with the PSR-3 standard.

## Minimum Requirements and Dependencies

Wonolog requires:

- PHP 5.6+
- WordPress 4.6+

Via [Composer](https://getcomposer.org), Wonolog requires `monolog/monolog` (MIT).

When installed for development, via Composer, Wonolog also requires:

- `phpunit/phpunit` (BSD-3-Clause)
- `brain/monkey` (MIT)
- `mikey179/vfsStream` (BSD-3-Clause)

## Getting Started

Wonolog should be installed via Composer.
Its package name is `inpsyde/wonolog`.

**The suggested way to use Wonolog is at website level.**

If you don't use Composer to manage your whole website then Wonolog is probably not for you.
You might be able to use it anyway, but support is not guaranteed.

It's easily possible to develop plugins and themes compatible with Wonolog logging even without explicitly declaring it as a dependency.

A couple of noteworthy things:

- all Wonolog configurations have to be done in a MU plugin;
- in a WordPress multisite installation, all Wonolog configurations are _naturally_ site-wide.

On the bright side, Wonolog comes with a super easy bootstrap routine and some out-of-the-box configurations that make it possible to have a working and effective logging system with zero effort.

To get started with defaults settings, this is required:

1. install Wonolog via Composer;
1. ensure Composer autoload is loaded in `wp-config.php` or anytime before the `'muplugins_loaded'` action is fired;
1. create a **MU plugin** that, at least, contains this code:

```php