Audit Log

Table of Contents

Creating a New Audit Entry
Associating Audit Entries With a Module
Including Custom Data With Audit Message
Shorthand Method of Creating Audit Entries

The Recite CMS audit log allows you as a developer to record exactly what is occurring in an installation of Recite CMS. Typically this will be to record exactly what users are doing, however the log can also be used to record other activity such as automated scripts or communication with third-party services.

The audit log can be accessed via the Recite CMS Administration Site.

Creating a New Audit Entry

To create a new audit entry, the Application_Auditor_Message class is used.

Typically an audit entry will contain one or more messages. These are intended to be human-readable strings of information.

You can write a message to the entry either by passing it as the first argument when instantiating Application_Auditor_Message, or by calling the add() method on the returned instance.

To write the entry to the Recite audit log, call the record() method.

Example 4.1. Creating and recording an audit message

<?php
    $message = new Application_Auditor_Message('Some action occurred');
    $message->add('This is a secondary message')
            ->record();
?>

Note

As demonstrated in this example, you can chain method calls together in this class.