Log

Joomla! Log Class

deprecated

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

1.0

deprecated

The joomla/log package is deprecated

Methods

__construct

Constructor.

__construct() 
since

1.0

add

Method to add an entry to the log.

add(mixed $entry, integer $priority = self::INFO, string $category = '', string $date = null, array $context = array()) : void
static
since

1.0

Arguments

$entry

mixedThe LogEntry object to add to the log or the message for a new LogEntry object.

$priority

integerMessage priority.

$category

stringType of entry

$date

stringDate of entry (defaults to now if not specified or blank)

$context

arrayAn optional array with additional message context.

addLogEntry

Method to add an entry to the appropriate loggers.

addLogEntry(\Joomla\Log\LogEntry $entry) : void
since

1.0

throws

\RuntimeException

Arguments

$entry

\Joomla\Log\LogEntryThe LogEntry object to send to the loggers.

addLogger

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

addLogger(array $options, integer $priorities = self::ALL, array $categories = array(), boolean $exclude = false) : void
static
since

1.0

Arguments

$options

arrayThe object configuration array.

$priorities

integerMessage priority

$categories

arrayTypes of entry

$exclude

booleanIf true, all categories will be logged except those in the $categories array

createDelegatedLogger

Creates a delegated PSR-3 compatible logger from the current singleton instance. This method always returns a new delegated logger.

createDelegatedLogger() : \Joomla\Log\DelegatingPsrLogger
static
since

1.3.0

Response

\Joomla\Log\DelegatingPsrLogger

findLoggers

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

findLoggers(integer $priority, string $category) : array
since

1.0

Arguments

$priority

integerMessage priority.

$category

stringType of entry

Response

arrayThe array of loggers to use for the given priority and category values.

setInstance

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

setInstance(\Joomla\Log\Log $instance) : void
static

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

since

1.0

Arguments

$instance

\Joomla\Log\LogThe logging object instance to be used by the static methods.

Constants

ALL

All log priorities.

since

1.0

EMERGENCY

The system is unusable.

since

1.0

ALERT

Action must be taken immediately.

since

1.0

CRITICAL

Critical conditions.

since

1.0

ERROR

Error conditions.

since

1.0

WARNING

Warning conditions.

since

1.0

NOTICE

Normal, but significant condition.

since

1.0

INFO

Informational message.

since

1.0

DEBUG

Debugging message.

since

1.0

Properties

instance

The global Log instance.

static
since

1.0

Type(s)

\Joomla\Log\Log

configurations

Container for AbstractLogger configurations.

since

1.0

Type(s)

array

loggers

Container for AbstractLogger objects.

since

1.0

Type(s)

array

lookup

Lookup array for loggers.

since

1.0

Type(s)

array