Dev:Logging Events

From Habari Project

(Redirected from Core:EventLog Class)
Jump to: navigation, search

The EventLog class provides methods for creating and retrieving event log entries in the database. It is also a container class which extends ArrayObject and is used to store a collection of event log entries.

Usage Examples

Create a Log Entry

log( $message, $severity = 'info', $type = 'default', $module = null, $data = null )

The static log method is used to create a log entry and store it in the database. It returns a boolean value, true for success and false on failure.

// Record a new log entry in the database. Record a severity of 'info', a type of 'default' and automatically work out the module.
EventLog::log( _t('Recording a new log entry.'), 'info', 'default' );
Personal tools