Back to Joomla project (class list)

Class Log - list of methods

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.
Package: Joomla\CMS\Log
Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Log/Log.php
Project: Joomla

Method Summary

protected
()

Constructor.
Since
  • 1.7.0
Show source code of this method: __construct Source Code

public static void
(mixed $entry, mixed $priority = self::INFO, mixed $category = '', mixed $date = null, array $context = array())

Method to add an entry to the log.
Parameters
  • mixed $entry The LogEntry object to add to the log or the message for a new LogEntry object.
  • int $priority Message priority.
  • string $category Type of entry
  • string $date Date of entry (defaults to now if not specified or blank)
  • array $context An optional array with additional message context.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: add Source Code

public static void
(array $options, mixed $priorities = self::ALL, mixed $categories = array(), mixed $exclude = false)

Add a logger to the Log instance. Loggers route log entries to the correct files/systems to be logged.
Parameters
  • array $options The object configuration array.
  • int $priorities Message priority
  • array $categories Types of entry
  • bool $exclude If true, all categories will be logged except those in the $categories array
Returns
  • void
Since
  • 1.7.0
Show source code of this method: addLogger Source Code

public void
(string $key, string $class, bool $replace = false)

Register a logger to the registry
Parameters
  • string $key The service key to be registered
  • string $class The class name of the logger
  • bool $replace Flag indicating the service key may replace an existing definition
Returns
  • void
Since
  • 4.0.0
Show source code of this method: registerLogger Source Code

protected void
(array $options, mixed $priorities = self::ALL, mixed $categories = array(), mixed $exclude = false)

Add a logger to the Log instance. Loggers route log entries to the correct files/systems to be logged.
Parameters
  • array $options The object configuration array.
  • int $priorities Message priority
  • array $categories Types of entry
  • bool $exclude If true, all categories will be logged except those in the $categories array
Returns
  • void
Since
  • 1.7.0
Show source code of this method: addLoggerInternal Source Code

public static \Joomla\CMS\Log\DelegatingPsrLogger
()

Creates a delegated PSR-3 compatible logger from the current singleton instance. This method always returns a new delegated logger.
Returns
  • \Joomla\CMS\Log\DelegatingPsrLogger
Since
  • 3.8.0
Show source code of this method: createDelegatedLogger Source Code

public static void
(mixed $instance)

Returns a reference to the a Log object, only creating it if it doesn't already exist.
Parameters
  • \Joomla\CMS\Log\Log $instance The logging object instance to be used by the static methods.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: setInstance Source Code

protected void
(\Joomla\CMS\Log\LogEntry $entry)

Method to add an entry to the appropriate loggers.
Parameters
  • \Joomla\CMS\Log\LogEntry $entry The LogEntry object to send to the loggers.
Returns
  • void
Since
  • 1.7.0
-
  • \RuntimeException
Show source code of this method: addLogEntry Source Code

protected array
(mixed $priority, mixed $category)

Method to find the loggers to use based on priority and category values.
Parameters
  • int $priority Message priority.
  • string $category Type of entry
Returns
  • array The array of loggers to use for the given priority and category values.
Since
  • 1.7.0
Show source code of this method: findLoggers Source Code

Properties Summary

protected static \Joomla\CMS\Log\Log
$instance
The global Log instance.
Since
  • 1.7.0
protected array
$configurations
Container for Logger configurations.
Since
  • 1.7.0
protected \Joomla\CMS\Log\Logger[]
$loggers
Container for Logger objects.
Since
  • 1.7.0
protected array
$lookup
Lookup array for loggers.
Since
  • 1.7.0
protected \Joomla\CMS\Log\LoggerRegistry
$loggerRegistry
The registry of available loggers
Since
  • 4.0.0

Constants Summary

public int
$ALL
All log priorities.
Since
  • 1.7.0
public int
$EMERGENCY
The system is unusable.
Since
  • 1.7.0
public int
$ALERT
Action must be taken immediately.
Since
  • 1.7.0
public int
$CRITICAL
Critical conditions.
Since
  • 1.7.0
public int
$ERROR
Error conditions.
Since
  • 1.7.0
public int
$WARNING
Warning conditions.
Since
  • 1.7.0
public int
$NOTICE
Normal, but significant condition.
Since
  • 1.7.0
public int
$INFO
Informational message.
Since
  • 1.7.0
public int
$DEBUG
Debugging message.
Since
  • 1.7.0

Tags Summary

Since
1.7.0