\JLog
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.
Synopsis
class JLog
{
- // constants
- const ALL = 30719;
- const EMERGENCY = 1;
- const ALERT = 2;
- const CRITICAL = 4;
- const ERROR = 8;
- const WARNING = 16;
- const NOTICE = 32;
- const INFO = 64;
- const DEBUG = 128;
- // members
- protected JLog $instance;
- protected $configurations;
- protected $loggers;
- protected $lookup;
- // methods
- protected void __construct()
- public static void add()
- public static void addLogger()
- public static void setInstance()
- protected void addLogEntry()
- protected array findLoggers()
Hierarchy
Extended by
Constants
Name | Value |
---|---|
ALL | 30719 |
EMERGENCY | 1 |
ALERT | 2 |
CRITICAL | 4 |
ERROR | 8 |
WARNING | 16 |
NOTICE | 32 |
INFO | 64 |
DEBUG | 128 |
Members
protected
- $configurations
—
array
Container for JLogLogger configurations. - $instance
—
JLog
The global JLog instance. - $loggers
—
array
Container for JLogLogger objects. - $lookup
—
array
Lookup array for loggers.
Methods
protected
- __construct() — Constructor.
- addLogEntry() — Method to add an entry to the appropriate loggers.
- findLoggers() — Method to find the loggers to use based on priority and category values.
public
- add() — Method to add an entry to the log.
- addLogger() — Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged.
- setInstance() — Returns a reference to the a JLog object, only creating it if it doesn't already exist.