2017 © Pedro Peláez
 

library wonolog

Monolog-based logging package for WordPress.

image

inpsyde/wonolog

Monolog-based logging package for WordPress.

  • Tuesday, May 15, 2018
  • by gmazzap
  • Repository
  • 12 Watchers
  • 75 Stars
  • 11,196 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 3 Forks
  • 1 Open issues
  • 12 Versions
  • 75 % Grown

The README.md

Wonolog

Version Status Build Downloads License, (*1)

Wonolog, (*2)

Monolog-based logging package for WordPress., (*3)


Table of Contents


Introduction

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

It is based on 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., (*5)

Minimum Requirements and Dependencies

Wonolog requires:, (*6)

  • PHP 5.6+
  • WordPress 4.6+

Via Composer, Wonolog requires monolog/monolog (MIT)., (*7)

When installed for development, via Composer, Wonolog also requires:, (*8)

  • 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., (*9)

The suggested way to use Wonolog is at website level., (*10)

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., (*11)

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

A couple of noteworthy things:, (*13)

  • 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., (*14)

To get started with defaults settings, this is required:, (*15)

  1. install Wonolog via Composer;
  2. ensure Composer autoload is loaded in wp-config.php or anytime before the 'muplugins_loaded' action is fired;
  3. create a MU plugin that, at least, contains this code:
<?php
Inpsyde\Wonolog\bootstrap();

Wonolog Defaults

The three steps described above are all that is necessary to have a working logging system that uses Monolog to write logs in a file. The path of that file changes based on current date, using the following format:, (*16)

  • {WP_CONTENT_DIR}/wonolog/{Y/m/d}.log,

with {Y/m/d} being replaced by date( 'Y/m/d' )., (*17)

For example, a target file could be /wp-content/2017/02/27.log., (*18)

What is actually logged depends on the value of WP_DEBUG_LOG constant., (*19)

When WP_DEBUG_LOG is set to true, Wonolog will log everything. When WP_DEBUG_LOG is set to false, Wonolog will only log events with a log level higher or equal to ERROR, according to PSR-3 log levels., (*20)

"Automatically" logged events include:, (*21)

  • PHP core notices, warnings and (fatal) errors;
  • uncaught exceptions;
  • WordPress errors and events (e.g., DB errors, HTTP API errors, wp_mail() errors, and 404 errors).

This is just the default behavior., (*22)

The bootstrap() function provides entry points for many configurations and customizations., (*23)

Moreover, the package provides both action and filter hooks, and can be configured via environment variables, which makes Wonolog very flexible, and exposes all the power that Monolog provides., (*24)

Learn More

Documentation of Wonolog features, defaults, configuration and ways to extends it can be found in separate files:, (*25)

Copyright (c) 2017 Inpsyde GmbH., (*26)

Wonolog code is licensed under MIT license., (*27)

The team at Inpsyde is engineering the Web since 2006., (*28)

The Versions

15/05 2018

dev-master

9999999-dev

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

15/05 2018

1.0.2

1.0.2.0

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

30/04 2018

dev-issue-34-cron-severity

dev-issue-34-cron-severity

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

08/02 2018

1.0.1

1.0.1.0

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

27/07 2017

dev-issue/23_htaccess

dev-issue/23_htaccess

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

03/07 2017

dev-issue-22

dev-issue-22

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

01/06 2017

1.0.0

1.0.0.0

Monolog-based logging package for WordPress.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger log psr-3 logging monolog debugging

08/11 2016

0.2.2

0.2.2.0

Monolog-based logger package for WordPress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger psr-3 logging monolog debugging

25/10 2016

0.2.1

0.2.1.0

Monolog-based logger package for WordPress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger psr-3 logging monolog debugging

20/10 2016

0.2.0

0.2.0.0

Monolog-based logger package for WordPress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger psr-3 logging monolog debugging

20/10 2016

0.1.1

0.1.1.0

Monolog-based logger package for WordPress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger psr-3 logging monolog debugging

18/10 2016

0.1.0

0.1.0.0

Monolog-based logger package for WordPress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress debug logger psr-3 logging monolog debugging