Michael Rog presents

RogEE: Add-ons for ExpressionEngine 2

Template OmniLogger 1.0

Template OmniLogger brings the event logging functionality of the OmniLog API into your ExpressionEngine templates.

About OmniLog

Stephen Lewis's OmniLog module provides a simple API for adding message logging capabilities to an ExpressionEngine add-on. Using OmniLog, add-on developers can easily log notices, warnings, and errors.

Better yet, OmniLog ensures that important messages don’t go unnoticed by emailing details of the log entry to site administrators (at your discretion, of course).

(You can read about the module and how it works on the OmniLog webpage.)

But what if you want to create entries in OmniLog entries based on events that run in your templates? That's where Template OmniLogger comes in.

Installation

  1. If you don't already have OmniLog installed, go grab it and drop it into your ExpressioneEngine installation.
  2. Un-ZIP the Template OmniLogger download and copy the /third_party/template_omnilogger folder into your /system/expressionengine/third_party direcotry.
  3. There is no Step 3.

Single tag → simple message (without Extended Content)

The only required parameter is the message you want to log:

{exp:template_omnilogger message="Something happened!"}

(If the message is empty, no log entry will be created.)

Tag pair → message with Extended Content

Again, the message parameter is required.

The contents of the tag pair will be recorded as the Extended Content of the log entry.

{exp:template_omnilogger message="Something happened!"}
Extended content goes here!
{/exp:template_omnilogger}

Parameters

The available parameters correspond to the log entry fields in OmniLog.