• Stars
    star
    172
  • Rank 221,201 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Monolog-based logging package for WordPress.

Wonolog

Version Status Build Downloads License

Wonolog

Monolog-based logging package for WordPress.


Table of Contents


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, 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, 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;
  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:

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

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

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

What is actually logged depends on the value of WP_DEBUG_LOG constant.

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.

"Automatically" logged events include:

  • 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.

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

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.

Learn More

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

License and Copyright

Copyright (c) 2017 Inpsyde GmbH.

Wonolog code is licensed under MIT license.

The team at Inpsyde is engineering the Web since 2006.

More Repositories

1

multilingual-press

The multisite-based free open source plugin for your multilingual WordPress websites.
PHP
234
star
2

php-coding-standards

Style guide for writing consistent PHP for WordPress projects.
PHP
97
star
3

menu-cache

Easily cache rendered menus using the Transients API.
PHP
72
star
4

objects-hooks-remover

Package to remove WordPress hook callbacks that uses object methods or closures.
PHP
53
star
5

WP-Stash

Bridge between WordPress and StashPHP, providing a PSR6-compliant caching system for WordPress
PHP
51
star
6

assets

Inpsyde Assets is a Composer package (not a plugin) that allows to deal with scripts and styles in a WordPress site.
PHP
49
star
7

wp-translation-downloader

Composer plugin to download WordPress translations
PHP
45
star
8

modularity

A PSR-11 implementation for WordPress Plugins, Themes or Libraries.
PHP
43
star
9

translation-cache

Improves site performance by caching translation files using WordPress object cache.
PHP
42
star
10

wp-app-container

DI Container and related tools to be used at website level.
PHP
37
star
11

more-menu-fields

Package to add more fields to WordPress menu edit screen.
PHP
33
star
12

wp-context

A single-class utility to check the current request context in WordPress sites.
PHP
31
star
13

wp-multisite-feed

WordPress Feed about all blogs inside a Multisite Network
PHP
29
star
14

composer-asset-compiler

Composer plugin that installs dependencies and compiles assets based on configuration.
PHP
25
star
15

WP-Tests-Starter

Package to simplify the set up of WordPress integration and system testing.
PHP
22
star
16

wordpress-core-autoloader

A proposal for a core WordPress autoloader module.
PHP
21
star
17

reusable-workflows

Reusable workflows for common GitHub Actions jobs.
JavaScript
20
star
18

CptArchives

Provides a post-like editing experience for post type archives.
PHP
18
star
19

MetaboxOrchestra

A Composer package that provides metabox orchestration for WordPress.
PHP
18
star
20

logzio-monolog

Logz.io integration into Monolog
PHP
17
star
21

validator

Inpsyde Validator library
PHP
16
star
22

google-tag-manager

Adds the Google Tag Manager container snippet to your site and populates the Google Tag Manager Data Layer.
PHP
16
star
23

WPSR7

PSR-7-compliant HTTP messages for WordPress.
PHP
15
star
24

wp-stubs

WordPress stubs
PHP
15
star
25

mini-plugins

PHP
14
star
26

plugin-templating-utils

Provides utility functions for templating functionality in plugins.
PHP
13
star
27

wpstarter-boilerplate

Common basic configuration for a WordPress site using Composer and WPStarter
Shell
12
star
28

disable-comments

A WordPress plugin that completely disables comments as a WordPress feature.
PHP
12
star
29

vip-composer-plugin

A Composer plugin to ease deployment to wordpress.com VIP servers alongside Composer-based local development.
PHP
11
star
30

wpml2mlp

Convert posts from an existing WPML multilingual site via WXR Export/Import for MultilingualPress
PHP
10
star
31

wp-db-tools

API for managing WordPress database tables
PHP
8
star
32

oembed-gist

Autoembedding of Gists in WordPress via oEmbed
PHP
7
star
33

MultilingualPress-Yoast-SEO-Sync

This is a simple add-on for the MultilingualPress plugin to synchronize the post metadata of the Yoast SEO plugin between translated posts.
PHP
7
star
34

woocommerce-product-changelog

WooCommerce Product Changelog
PHP
6
star
35

monkery-test-case

Composes all relevant packages for WP components unit testing
PHP
6
star
36

woocommerce-multisite-persistent-cart

Multisite aware persistent storage for user carts
PHP
5
star
37

filter

Inpsyde Filter library.
PHP
4
star
38

multilingualpress-2-to-3-migration

Procedures to migrate MultilingualPress v2 to MultilingualPress v3
PHP
4
star
39

WP-API-JSON-Adapter

Plugin that provides interfaces to change the data structure of the WP-API plugin.
PHP
4
star
40

paypal-plus-plugin

The official PayPal Plus Plugin for WooCommerce - adds payment via PayPal, Direct debit, Credit card and Pay upon invoice to your WooCommerce Shop.
PHP
3
star
41

dynamic-test-examples

This repositories shows examples on dynamic software testing
PHP
3
star
42

jeopardy

Das WordPress Jeopardy Theme
PHP
3
star
43

translationmanager

With TranslationMANAGER, exporting content from your WordPress Multisite is easy and straightforward.
PHP
3
star
44

woocommerce-product-variations-description

WooCommerce Product Variations Description
PHP
2
star
45

wp-db-types

DEPRECATED. See https://github.com/inpsyde/wp-db-tools instead
PHP
2
star
46

antispam

Simple antispam solution with the magic of javascript
PHP
2
star
47

top-selling-products

Lightweight package providing a pre-configured, yet filterable WP_Query extension for top selling products.
PHP
1
star
48

inpsyde

Germany's biggest WordPress agency. Just Inpsyde.
1
star
49

prettier-config

Shared Prettier configuration for Inpsyde projects
1
star
50

create-codeship-build-action

A GitHub action that creates a build on Codeship via its API.
PHP
1
star
51

uncapitalize_p

WordPress plugin that will remove capitalize-p filters from content hooks.
PHP
1
star
52

remove-woothemes-install-notice

Removes the admin notice that urges you to install the WooThemes installer
PHP
1
star
53

multilingualpress-site-flags

Add flags to MultilingualPress.
PHP
1
star
54

akismet-privacy-policies

Ergänzt das Kommentarformular um datenschutzrechtliche Hinweise bei Nutzung des Plugins Akismet.
PHP
1
star