class JLog


Located at : UKNOWVA_ROOT/libraries/joomla/log/log.php

Joomla! Log Class

This class hooks into the global log configuration settings to allow for user configured logging events to be sent to where the user wishes them to be sent. On high load sites SysLog is probably the best (pure PHP function), then the text file based loggers (CSV, W3C or plain FormattedText) and finally MySQL offers the most features (e.g. rapid searching) but will incur a performance hit due to INSERT being issued.

Constants

ALL

All log priorities.

EMERGENCY

The system is unusable.

ALERT

Action must be taken immediately.

CRITICAL

Critical conditions.

ERROR

Error conditions.

WARNING

Warning conditions.

NOTICE

Normal, but significant condition.

INFO

Informational message.

DEBUG

Debugging message.

Properties

static array $legacy The array of instances created through the deprecated getInstance method.

Methods

static void
add(mixed $entry, integer $priority = JLog::INFO, string $category = '', string $date = null)

Method to add an entry to the log.

static void
addLogger(array $options, integer $priorities = JLog::ALL, array $categories = array())

Method to set the way the JError will handle different error levels.

static JLog
getInstance(string $file = 'error.php', array $options = null, string $path = null) deprecated

Returns a JLog object for a given log file/configuration, only creating it if it doesn't already exist.

static void
setInstance(JLog $instance)

Returns a reference to the a JLog object, only creating it if it doesn't already exist.

boolean
addEntry(array $entry) deprecated

Method to add an entry to the log file.

Details

at line 160
static void add(mixed $entry, integer $priority = JLog::INFO, string $category = '', string $date = null)

Method to add an entry to the log.

Parameters

mixed $entry The JLogEntry object to add to the log or the message for a new JLogEntry object.
integer $priority Message priority.
string $category Type of entry
string $date Date of entry (defaults to now if not specified or blank)

Return Value

void

at line 187
static void addLogger(array $options, integer $priorities = JLog::ALL, array $categories = array())

Method to set the way the JError will handle different error levels.

Use this if you want to override the default settings.

Parameters

array $options The object configuration array.
integer $priorities Message priority
array $categories Types of entry

Return Value

void

at line 227
static JLog getInstance(string $file = 'error.php', array $options = null, string $path = null) deprecated

deprecated 12.1

Returns a JLog object for a given log file/configuration, only creating it if it doesn't already exist.

This method must be invoked as: $log = JLog::getInstance($file, $options, $path);

Parameters

string $file The filename of the log file.
array $options The object configuration array.
string $path The base path for the log file.

Return Value

JLog

at line 278
static void setInstance(JLog $instance)

Returns a reference to the a JLog object, only creating it if it doesn't already exist.

Note: This is principly made available for testing and internal purposes.

Parameters

JLog $instance The logging object instance to be used by the static methods.

Return Value

void

at line 295
boolean addEntry(array $entry) deprecated

deprecated 12.1

Method to add an entry to the log file.

Parameters

array $entry Array of values to map to the format string for the log file.

Return Value

boolean True on success.