Class JLog

Description

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.

  • since: 11.1

Located in /libraries/joomla/log/log.php (line 34)


	
			
Class Constant Summary
ALERT = 2
ALL = 30719
CRITICAL = 4
DEBUG = 128
EMERGENCY = 1
ERROR = 8
INFO = 64
NOTICE = 32
WARNING = 16
Variable Summary
static JLog $instance
static array $legacy
array $loggers
array $lookup
Method Summary
static void add (mixed $entry, [integer $priority = JLog::INFO], [string $category = ''], [string $date = null])
static void addLogger (array $options, [integer $priorities = JLog::ALL], [array $categories = array()])
static JLog getInstance ([string $file = 'error.php'], [array $options = null], [string $path = null])
static void setInstance (JLog $instance)
JLog __construct ()
boolean addEntry (array $entry)
void addLogEntry (JLogEntry $entry)
array findLoggers (integer $priority, string $category)
Variables
static JLog $instance (line 104)

The global JLog instance.

  • since: 11.1
  • access: protected
static array $legacy = array() (line 113)

The array of instances created through the deprecated getInstance method.

array $configurations = array() (line 120)

Container for JLogger configurations.

  • since: 11.1
  • access: protected
array $loggers = array() (line 127)

Container for JLogger objects.

  • since: 11.1
  • access: protected
array $lookup = array() (line 134)

Lookup array for loggers.

  • since: 11.1
  • access: protected
Methods
static method add (line 157)

Method to add an entry to the log.

  • since: 11.1
  • access: public
static void add (mixed $entry, [integer $priority = JLog::INFO], [string $category = ''], [string $date = null])
  • 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)
static method addLogger (line 186)

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

Use this if you want to override the default settings.

  • since: 11.1
  • access: public
static void addLogger (array $options, [integer $priorities = JLog::ALL], [array $categories = array()])
  • array $options: The object configuration array.
  • integer $priorities: Message priority
  • array $categories: Types of entry
static method getInstance (line 231)

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:

  1. $log JLog::getInstance($file$options$path);

  • deprecated: 12.1
  • since: 11.1
  • access: public
static JLog getInstance ([string $file = 'error.php'], [array $options = null], [string $path = null])
  • string $file: The filename of the log file.
  • array $options: The object configuration array.
  • string $path: The base path for the log file.
static method setInstance (line 285)

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

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

  • since: 11.1
  • access: public
static void setInstance (JLog $instance)
  • JLog $instance: The logging object instance to be used by the static methods.
Constructor __construct (line 141)

Constructor.

  • since: 11.1
  • access: protected
JLog __construct ()
addEntry (line 304)

Method to add an entry to the log file.

  • return: True on success.
  • deprecated: 12.1 Use JLog::add() instead.
  • since: 11.1
  • access: public
boolean addEntry (array $entry)
  • array $entry: Array of values to map to the format string for the log file.
addLogEntry (line 359)

Method to add an entry to the appropriate loggers.

  • since: 11.1
  • throws: LogException
  • access: protected
void addLogEntry (JLogEntry $entry)
  • JLogEntry $entry: The JLogEntry object to send to the loggers.
findLoggers (line 396)

Method to find the loggers to use based on priority and category values.

  • return: The array of loggers to use for the given priority and category values.
  • since: 11.1
  • access: protected
array findLoggers (integer $priority, string $category)
  • integer $priority: Message priority.
  • string $category: Type of entry
Class Constants
ALERT = 2 (line 55)

Action must be taken immediately.

  • since: 11.1
ALL = 30719 (line 41)

All log priorities.

  • since: 11.1
CRITICAL = 4 (line 62)

Critical conditions.

  • since: 11.1
DEBUG = 128 (line 97)

Debugging message.

  • since: 11.1
EMERGENCY = 1 (line 48)

The system is unusable.

  • since: 11.1
ERROR = 8 (line 69)

Error conditions.

  • since: 11.1
INFO = 64 (line 90)

Informational message.

  • since: 11.1
NOTICE = 32 (line 83)

Normal, but significant condition.

  • since: 11.1
WARNING = 16 (line 76)

Warning conditions.

  • since: 11.1

Documentation generated on Mon, 25 Jun 2012 13:56:26 -0500 by phpDocumentor 1.4.4