Log
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 |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor.
__construct() :
since |
1.7.0 |
---|
Response
mixed
add
Method to add an entry to the log.
add( entry, priority = self::INFO, category = '', date = null, mixed||string|int context = []) :
since |
1.7.0 |
---|
Arguments
- entry
mixed
The LogEntry object to add to the log or the message for a new LogEntry object.- priority
int
Message priority.- category
string
Type of entry- date
string
Date of entry (defaults to now if not specified or blank)- context
array<string|int, mixed>
An optional array with additional message context.
Response
void
addLogEntry
Method to add an entry to the appropriate loggers.
addLogEntry(\Joomla\CMS\Log\LogEntry entry) :
since |
1.7.0 |
---|---|
throws |
|
Arguments
- entry
LogEntry
The LogEntry object to send to the loggers.
Response
void
addLogger
Add a logger to the Log instance. Loggers route log entries to the correct files/systems to be logged.
addLogger(mixed||string|int options, priorities = self::ALL, mixed||string|int categories = [], exclude = false) :
since |
1.7.0 |
---|
Arguments
- options
array<string|int, mixed>
The object configuration array.- priorities
int
Message priority- categories
array<string|int, mixed>
Types of entry- exclude
bool
If true, all categories will be logged except those in the $categories array
Response
void
addLoggerInternal
Add a logger to the Log instance. Loggers route log entries to the correct files/systems to be logged.
addLoggerInternal(mixed||string|int options, priorities = self::ALL, mixed||string|int categories = [], exclude = false) :
This method allows you to extend Log completely.
since |
1.7.0 |
---|
Arguments
- options
array<string|int, mixed>
The object configuration array.- priorities
int
Message priority- categories
array<string|int, mixed>
Types of entry- exclude
bool
If true, all categories will be logged except those in the $categories array
Response
void
createDelegatedLogger
Creates a delegated PSR-3 compatible logger from the current singleton instance. This method always returns a new delegated logger.
createDelegatedLogger() : \Joomla\CMS\Log\DelegatingPsrLogger
since |
3.8.0 |
---|
Response
DelegatingPsrLogger
findLoggers
Method to find the loggers to use based on priority and category values.
findLoggers( priority, category) : mixed||string|int
since |
1.7.0 |
---|
Arguments
- priority
int
Message priority.- category
string
Type of entry
Response
array<string|int, mixed>
The array of loggers to use for the given priority and category values.
registerLogger
Register a logger to the registry
registerLogger( key, class, replace = false) :
since |
4.0.0 |
---|
Arguments
- key
string
The service key to be registered- class
string
The class name of the logger- replace
bool
Flag indicating the service key may replace an existing definition
Response
void
setInstance
Returns a reference to the a Log object, only creating it if it doesn't already exist.
setInstance(\Joomla\CMS\Log\Log instance) :
Note: This is principally made available for testing and internal purposes.
since |
1.7.0 |
---|
Arguments
- instance
Log
The logging object instance to be used by the static methods.
Response
void
Constants
ALL
All log priorities.
Value | 30719 |
---|---|
since |
1.7.0 |
Type(s)
int
EMERGENCY
The system is unusable.
Value | 1 |
---|---|
since |
1.7.0 |
Type(s)
int
ALERT
Action must be taken immediately.
Value | 2 |
---|---|
since |
1.7.0 |
Type(s)
int
CRITICAL
Critical conditions.
Value | 4 |
---|---|
since |
1.7.0 |
Type(s)
int
ERROR
Error conditions.
Value | 8 |
---|---|
since |
1.7.0 |
Type(s)
int
WARNING
Warning conditions.
Value | 16 |
---|---|
since |
1.7.0 |
Type(s)
int
NOTICE
Normal, but significant condition.
Value | 32 |
---|---|
since |
1.7.0 |
Type(s)
int
INFO
Informational message.
Value | 64 |
---|---|
since |
1.7.0 |
Type(s)
int
DEBUG
Debugging message.
Value | 128 |
---|---|
since |
1.7.0 |
Type(s)
int
Properties
configurations
Container for Logger configurations.
since |
1.7.0 |
---|
Type(s)
array<string|int, mixed>
lookup
Lookup array for loggers.
since |
1.7.0 |
---|
Type(s)
array<string|int, mixed>