Back to Log class

Method addLogger

public static void
addLogger
(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
Class: Log
Project: Joomla

Method addLogger - Source code

/**
 * Add a logger to the Log instance.  Loggers route log entries to the correct files/systems to be logged.
 *
 * @param   array    $options     The object configuration array.
 * @param   integer  $priorities  Message priority
 * @param   array    $categories  Types of entry
 * @param   boolean  $exclude     If true, all categories will be logged except those in the $categories array
 *
 * @return  void
 *
 * @since   1.7.0
 */
public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false)
{
    // Automatically instantiate the singleton object if not already done.
    if (empty(static::$instance)) {
        static::setInstance(new static());
    }
    static::$instance->addLoggerInternal($options, $priorities, $categories, $exclude);
}