WordPress plugin intelligence profile

Bang System Logging

Enable system logging for WordPress plugin and theme development.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 3.5
Current version1.2
WordPress coverageTested up to WordPress 3.5
Minimum stackWP 3.0 · PHP —
Directory statusactive
Last directory update30 Aug 201313y ago
Active installations10Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Bang System Logging version 1.2 as active, updated 13y ago and tested up to WordPress 3.5.

Overview

About this plugin

Enable system logging for WordPress plugin and theme development. This can make it easier to know what your code is doing.

Features include:

  • Log to the system log or to a file
  • Easily append or embed any value in log messages
  • Coloured logs indicating strings, numbers, arrays, objects, null values etc.
  • Extract values from arrays of objects
  • Optionally exclude AJAX, Javascripts, CSS and any other pattern of URLs.
  • Intercept PHP errors and log strict warnings
  • Measure memory usage between two points, or the time taken by various parts of your code
  • Easy to switch off for production sites

How to use

Using it is as simple as calling the 'log' action in your templates or plugin.

>

This will produce a line in your system log:

com/path-to-page: Some log message

This includes:

  • Jun 4 11:23:08 – The date and time of the log message
  • myserver – The name of this computer
  • php – The program that produced the message
  • mysite.com – The domain name of the site
  • 1553 – The process ID of the running PHP process
  • b8e – A random 3-digit code identifying each page request
  • mysite.com/path-to-page – The URL of the request
  • Some log message – Your message

For more detailed instructions, see the How to use tab.

How to use

To log a message, use the 'log' action in your templates or plugins:

>

This will output the log message:

Some log message

Embedding values

If you include extra parameters, they’ll be added at the end of the log message:

>

This will produce the log message:

A number and a string: 17, foo

The value will be formatted correctly depending on its type: integers, strings, arrays, objects, booleans etc.

You don’t need to check if values are null or empty, they’ll still be output safely.

If you put the code %s into your log message, then one of the arguments will be dropped into the message:

>

This will produce the log message:

I have 4 numbers: [9, 16, 307, 1]

Selecting fields

Logging a complete object – such as a WordPress post – can be very large, and sometimes it’s only one or two fields you need.

" followed by a list of field names, they will be selected from the following object.

The following will only show the ID and post_title fields of the post:

>

This will produce the log message:

Loaded the post: {ID: 1932, post_title: Test page}

If you do this with an array of objects, those fields will be selected from each of them. The following will output a list of post ID s:

>

This will produce the log message:

Loaded 3 posts: [1932, 1594, 1103]

Coloured logs

If you have coloured logging switched on, values will appear in different colours to indicate their type.

This can make for quicker scanning of log files.

To enable coloured logs, tick the Coloured logs checkbox on the settings page.

sh script, included with this plugin, to decode and display the coloured log files.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • debug
  • syslog
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 3.5

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 3.5.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to3.5
Minimum requirementsWordPress 3.0 · PHP not listed
Update activity30 Aug 201313y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.