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 25)


	
			
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
 array $loggers
 array $lookup
Method Summary
 static void add (mixed $entry, [integer $priority = self::INFO], [string $category = ''], [string $date = null])
 static void addLogger (array $options, [integer $priorities = self::ALL], [array $categories = array()], [boolean $exclude = false])
 static void setInstance (JLog $instance)
 JLog __construct ()
 void addLogEntry (JLogEntry $entry)
 array findLoggers (integer $priority, string $category)
Variables
static JLog $instance (line 95)

The global JLog instance.

  • since: 11.1
  • access: protected
array $configurations = array() (line 102)

Container for JLogLogger configurations.

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

Container for JLogLogger objects.

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

Lookup array for loggers.

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

Method to add an entry to the log.

  • since: 11.1
  • access: public
static void add (mixed $entry, [integer $priority = self::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 addLogger (line 168)

Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged.

  • since: 11.1
  • access: public
static void addLogger (array $options, [integer $priorities = self::ALL], [array $categories = array()], [boolean $exclude = false])
  • array $options: The object configuration array.
  • integer $priorities: Message priority
  • array $categories: Types of entry
  • boolean $exclude: If true, all categories will be logged except those in the $categories array
static setInstance (line 222)

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 123)

Constructor.

  • since: 11.1
  • access: protected
JLog __construct ()
addLogEntry (line 240)

Method to add an entry to the appropriate loggers.

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

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 46)

Action must be taken immediately.

  • since: 11.1
ALL = 30719 (line 32)

All log priorities.

  • since: 11.1
CRITICAL = 4 (line 53)

Critical conditions.

  • since: 11.1
DEBUG = 128 (line 88)

Debugging message.

  • since: 11.1
EMERGENCY = 1 (line 39)

The system is unusable.

  • since: 11.1
ERROR = 8 (line 60)

Error conditions.

  • since: 11.1
INFO = 64 (line 81)

Informational message.

  • since: 11.1
NOTICE = 32 (line 74)

Normal, but significant condition.

  • since: 11.1
WARNING = 16 (line 67)

Warning conditions.

  • since: 11.1

Documentation generated on Tue, 19 Nov 2013 15:07:24 +0100 by phpDocumentor 1.4.3