Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JLog

Liste de tous les membres

Fonctions membres publiques statiques

static add ($entry, $priority=self::INFO, $category= '', $date=null)
static addLogger (array $options, $priorities=self::ALL, $categories=array(), $exclude=false)
static setInstance ($instance)

Attributs publics

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

Fonctions membres protégées

 __construct ()
 addLogEntry (JLogEntry $entry)
 findLoggers ($priority, $category)

Attributs protégés

 $configurations = array()
 $loggers = array()
 $lookup = array()

Attributs protégés statiques

static $instance

Description détaillée

Définition à la ligne 25 du fichier log.php.


Documentation des constructeurs et destructeur

JLog::__construct ( )
protected

Constructor.

Depuis:
11.1

Définition à la ligne 123 du fichier log.php.

{
}

Documentation des fonctions membres

static JLog::add (   $entry,
  $priority = self::INFO,
  $category = '',
  $date = null 
)
static

Method to add an entry to the log.

Paramètres:
mixed$entryThe JLogEntry object to add to the log or the message for a new JLogEntry object.
integer$priorityMessage priority.
string$categoryType of entry
string$dateDate of entry (defaults to now if not specified or blank)
Renvoie:
void
Depuis:
11.1

Définition à la ligne 139 du fichier log.php.

Référencé par JDispatcher\__construct(), JTableSession\__construct(), JWebClient\__construct(), JRule\__construct(), JRules\__construct(), JImageFilter\__construct(), JWeb\__construct(), JSimplecrypt\__construct(), JCli\__construct(), JDaemon\__construct(), JNode\__construct(), JTree\__construct(), JImage\__construct(), JLogger\__construct(), JAuthentication\__construct(), JApplicationDaemon\__construct(), JException\__construct(), JViewLegacy\__construct(), JFTP\__construct(), JFormField\__set(), JException\__toString(), JCacheStorageFile\_deleteFolder(), JCacheStorageFile\_filesInFolder(), JCacheStorageFile\_folders(), JClientFtp\_mode(), JClientFtp\_passive(), JClientFtp\_putCmd(), JClientFtp\_verifyResponse(), JUserHelper\activateUser(), JNode\addChild(), JTree\addChild(), JError\addToStack(), JXMLElement\asFormattedXML(), JViewLegacy\assign(), JViewLegacy\assignRef(), JError\attachHandler(), JAuthentication\authenticate(), JControllerLegacy\authorise(), JApplicationDaemon\changeIdentity(), JClientFtp\chdir(), JControllerLegacy\checkEditId(), JClientFtp\chmod(), JClientFtp\connect(), JFile\copy(), JFolder\create(), JClientFtp\create(), JError\customErrorHandler(), JError\customErrorPage(), JApplicationDaemon\daemonize(), JControllerAdmin\delete(), JFile\delete(), JFolder\delete(), JClientFtp\delete(), JModelAdmin\delete(), JApplicationDaemon\detach(), JError\detachHandler(), JDatabaseDriverMysql\execute(), JDatabaseDriverPdo\execute(), JApplicationDaemon\execute(), JDatabaseDriverMysqli\execute(), JDatabaseDriverSqlsrv\execute(), JDatabaseDriverPostgresql\execute(), JFolder\files(), JUpdaterExtension\findUpdate(), JUpdaterCollection\findUpdate(), JFolder\folders(), JApplicationDaemon\fork(), JException\get(), JClientFtp\get(), JFactory\getACL(), JAccess\getActions(), JNode\getChildren(), JDatabase\getConnectors(), JFactory\getEditor(), JError\getError(), JException\getError(), JError\getErrorHandling(), JDatabase\getErrorMsg(), JDatabase\getErrorNum(), JError\getErrors(), JException\getErrors(), JSimplepieFactory\getFeedParser(), JFactory\getFeedParser(), JImage\getFilterInstance(), JDatabase\getInstance(), JModelLegacy\getInstance(), JUser\getInstance(), JTable\getInstance(), JFile\getName(), JFormFieldCategory\getOptions(), JFormFieldPlugins\getOptions(), JUser\getParameters(), JTree\getParent(), JNode\getParent(), JException\getProperties(), JFactory\getURI(), JDatabaseDriver\getUTFSupport(), JFactory\getXML(), JError\handleCallback(), JError\handleDie(), JError\handleEcho(), JError\handleIgnore(), JError\handleLog(), JError\handleMessage(), JError\handleVerbose(), JNode\hasChildren(), JNode\hasParent(), JControllerLegacy\holdEditId(), JBrowser\identifyBrowserVersion(), JApplicationDaemon\isActive(), JError\isError(), JBrowser\isSSLConnection(), JApplication\isWinOS(), JClientFtp\listDetails(), JClientFtp\listNames(), JUser\load(), JImage\loadFile(), JUpdate\loadFromXML(), JDatabaseDriver\loadNextObject(), JDatabaseDriver\loadNextRow(), JClientFtp\login(), JClientFtp\mkdir(), JFile\move(), JXMLElement\name(), JControllerAdmin\publish(), JModelAdmin\publish(), JClientFtp\pwd(), JDatabase\query(), JError\raise(), JError\raiseError(), JError\raiseNotice(), JError\raiseWarning(), JFile\read(), JClientFtp\read(), JError\registerErrorLevel(), JClientFtp\reinit(), JControllerLegacy\releaseEditId(), JClientFtp\rename(), JError\renderBacktrace(), JModelAdmin\reorder(), JTree\reset(), JApplicationDaemon\restart(), JClientFtp\restart(), JModelAdmin\saveorder(), JException\set(), JException\setError(), JError\setErrorHandling(), JViewLegacy\setEscape(), JNode\setParent(), JException\setProperties(), JMail\setSender(), JApplicationDaemon\setupSignalHandlers(), JApplicationDaemon\shutdown(), JApplicationDaemon\signal(), JString\splitCamelCase(), JDatabase\splitSql(), JDatabase\stderr(), JApplicationDaemon\stop(), JClientFtp\store(), JClientFtp\syst(), JDatabase\test(), JSessionStorage\test(), JCacheStorage\test(), JError\throwError(), JException\toString(), JError\translateErrorLevel(), JFile\upload(), JFile\write(), JClientFtp\write(), et JApplicationDaemon\writeProcessIdFile().

{
// Automatically instantiate the singleton object if not already done.
if (empty(self::$instance))
{
}
// If the entry object isn't a JLogEntry object let's make one.
if (!($entry instanceof JLogEntry))
{
$entry = new JLogEntry((string) $entry, $priority, $category, $date);
}
self::$instance->addLogEntry($entry);
}
JLog::addLogEntry ( JLogEntry  $entry)
protected

Method to add an entry to the appropriate loggers.

Paramètres:
JLogEntry$entryThe JLogEntry object to send to the loggers.
Renvoie:
void
Depuis:
11.1
Exceptions:
RuntimeException

Définition à la ligne 240 du fichier log.php.

{
// Find all the appropriate loggers based on priority and category for the entry.
$loggers = $this->findLoggers($entry->priority, $entry->category);
foreach ((array) $loggers as $signature)
{
// Attempt to instantiate the logger object if it doesn't already exist.
if (empty($this->loggers[$signature]))
{
$class = 'JLogLogger' . ucfirst($this->configurations[$signature]['logger']);
if (class_exists($class))
{
$this->loggers[$signature] = new $class($this->configurations[$signature]);
}
else
{
throw new RuntimeException('Unable to create a JLogLogger instance: ' . $class);
}
}
// Add the entry to the logger.
$this->loggers[$signature]->addEntry(clone($entry));
}
}
static JLog::addLogger ( array  $options,
  $priorities = self::ALL,
  $categories = array(),
  $exclude = false 
)
static

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

Paramètres:
array$optionsThe object configuration array.
integer$prioritiesMessage priority
array$categoriesTypes of entry
boolean$excludeIf true, all categories will be logged except those in the $categories array
Renvoie:
void
Depuis:
11.1

Définition à la ligne 168 du fichier log.php.

Référencé par JControllerLegacy\__construct(), et JError\handleLog().

{
// Automatically instantiate the singleton object if not already done.
if (empty(self::$instance))
{
}
// The default logger is the formatted text log file.
if (empty($options['logger']))
{
$options['logger'] = 'formattedtext';
}
$options['logger'] = strtolower($options['logger']);
// Special case - if a Closure object is sent as the callback (in case of JLogLoggerCallback)
// Closure objects are not serializable so swap it out for a unique id first then back again later
if (isset($options['callback']) && is_a($options['callback'], 'closure'))
{
$callback = $options['callback'];
$options['callback'] = spl_object_hash($options['callback']);
}
// Generate a unique signature for the JLog instance based on its options.
$signature = md5(serialize($options));
// Now that the options array has been serialized, swap the callback back in
if (isset($callback))
{
$options['callback'] = $callback;
}
// Register the configuration if it doesn't exist.
if (empty(self::$instance->configurations[$signature]))
{
self::$instance->configurations[$signature] = $options;
}
self::$instance->lookup[$signature] = (object) array(
'priorities' => $priorities,
'categories' => array_map('strtolower', (array) $categories),
'exclude' => (bool) $exclude);
}

+ Voici le graphe des appelants de cette fonction :

JLog::findLoggers (   $priority,
  $category 
)
protected

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

Paramètres:
integer$priorityMessage priority.
string$categoryType of entry
Renvoie:
array The array of loggers to use for the given priority and category values.
Depuis:
11.1

Définition à la ligne 278 du fichier log.php.

{
$loggers = array();
// Sanitize inputs.
$priority = (int) $priority;
$category = strtolower($category);
// Let's go iterate over the loggers and get all the ones we need.
foreach ((array) $this->lookup as $signature => $rules)
{
// Check to make sure the priority matches the logger.
if ($priority & $rules->priorities)
{
if ($rules->exclude)
{
// If either there are no set categories or the category (including the empty case) is not in the list of excluded categories, add this logger.
if (empty($rules->categories) || !in_array($category, $rules->categories))
{
$loggers[] = $signature;
}
}
else
{
// If either there are no set categories (meaning all) or the specific category is set, add this logger.
if (empty($category) || empty($rules->categories) || in_array($category, $rules->categories))
{
$loggers[] = $signature;
}
}
}
}
return $loggers;
}
static JLog::setInstance (   $instance)
static

Returns a reference to the a JLog object, only creating it if it doesn't already exist. Note: This is principally made available for testing and internal purposes.

Paramètres:
JLog$instanceThe logging object instance to be used by the static methods.
Renvoie:
void
Depuis:
11.1

Définition à la ligne 222 du fichier log.php.

{
if (($instance instanceof JLog) || $instance === null)
{
self::$instance = & $instance;
}
}

Documentation des données membres

JLog::$configurations = array()
protected

Définition à la ligne 102 du fichier log.php.

JLog::$instance
staticprotected

Définition à la ligne 95 du fichier log.php.

JLog::$loggers = array()
protected

Définition à la ligne 109 du fichier log.php.

JLog::$lookup = array()
protected

Définition à la ligne 116 du fichier log.php.

const JLog::ALERT = 2

Définition à la ligne 46 du fichier log.php.

Référencé par JLogLoggerMessagequeue\addEntry().

const JLog::ALL = 30719

Définition à la ligne 32 du fichier log.php.

Référencé par JControllerLegacy\__construct(), et JError\handleLog().

const JLog::CRITICAL = 4

Définition à la ligne 53 du fichier log.php.

Référencé par JLogLoggerMessagequeue\addEntry(), et JApplicationDaemon\daemonize().

const JLog::NOTICE = 32

Définition à la ligne 74 du fichier log.php.

Référencé par JLogLoggerMessagequeue\addEntry(), et JBrowser\identifyBrowserVersion().

const JLog::WARNING = 16

Définition à la ligne 67 du fichier log.php.

Référencé par JDispatcher\__construct(), JTableSession\__construct(), JWebClient\__construct(), JRule\__construct(), JRules\__construct(), JWeb\__construct(), JSimplecrypt\__construct(), JCli\__construct(), JDaemon\__construct(), JNode\__construct(), JTree\__construct(), JLogger\__construct(), JAuthentication\__construct(), JException\__construct(), JViewLegacy\__construct(), JLDAP\__construct(), JFTP\__construct(), JException\__toString(), JCacheStorageFile\_deleteFolder(), JCacheStorageFile\_filesInFolder(), JCacheStorageFile\_folders(), JClientFtp\_mode(), JClientFtp\_passive(), JClientFtp\_putCmd(), JClientFtp\_verifyResponse(), JUserHelper\activateUser(), JNode\addChild(), JTree\addChild(), JLogLoggerMessagequeue\addEntry(), JError\addToStack(), JXMLElement\asFormattedXML(), JViewLegacy\assign(), JViewLegacy\assignRef(), JError\attachHandler(), JAuthentication\authenticate(), JControllerLegacy\authorise(), JClientFtp\chdir(), JClientFtp\chmod(), JClientFtp\connect(), JFile\copy(), JFolder\create(), JClientFtp\create(), JError\customErrorHandler(), JError\customErrorPage(), JApplicationDaemon\daemonize(), JControllerAdmin\delete(), JFile\delete(), JFolder\delete(), JClientFtp\delete(), JModelAdmin\delete(), JError\detachHandler(), JFolder\files(), JUpdaterExtension\findUpdate(), JUpdaterCollection\findUpdate(), JFolder\folders(), JException\get(), JClientFtp\get(), JFactory\getACL(), JAccess\getActions(), JNode\getChildren(), JDatabase\getConnectors(), JFactory\getEditor(), JError\getError(), JException\getError(), JError\getErrorHandling(), JDatabase\getErrorMsg(), JDatabase\getErrorNum(), JError\getErrors(), JException\getErrors(), JSimplepieFactory\getFeedParser(), JFactory\getFeedParser(), JDatabase\getInstance(), JModelLegacy\getInstance(), JUser\getInstance(), JTable\getInstance(), JFile\getName(), JFormFieldCategory\getOptions(), JFormFieldPlugins\getOptions(), JUser\getParameters(), JTree\getParent(), JNode\getParent(), JException\getProperties(), JFactory\getURI(), JDatabaseDriver\getUTFSupport(), JFactory\getXML(), JError\handleCallback(), JError\handleDie(), JError\handleEcho(), JError\handleIgnore(), JError\handleLog(), JError\handleMessage(), JError\handleVerbose(), JNode\hasChildren(), JNode\hasParent(), JApplicationDaemon\isActive(), JError\isError(), JBrowser\isSSLConnection(), JApplication\isWinOS(), JClientFtp\listDetails(), JClientFtp\listNames(), JUser\load(), JUpdate\loadFromXML(), JDatabaseDriver\loadNextObject(), JDatabaseDriver\loadNextRow(), JClientFtp\login(), JClientFtp\mkdir(), JFile\move(), JXMLElement\name(), JControllerAdmin\publish(), JModelAdmin\publish(), JClientFtp\pwd(), JDatabase\query(), JError\raise(), JError\raiseError(), JError\raiseNotice(), JError\raiseWarning(), JFile\read(), JClientFtp\read(), JError\registerErrorLevel(), JClientFtp\reinit(), JClientFtp\rename(), JError\renderBacktrace(), JModelAdmin\reorder(), JTree\reset(), JClientFtp\restart(), JModelAdmin\saveorder(), JException\set(), JException\setError(), JError\setErrorHandling(), JViewLegacy\setEscape(), JNode\setParent(), JException\setProperties(), JMail\setSender(), JString\splitCamelCase(), JDatabase\splitSql(), JDatabase\stderr(), JClientFtp\store(), JClientFtp\syst(), JDatabase\test(), JSessionStorage\test(), JCacheStorage\test(), JError\throwError(), JException\toString(), JError\translateErrorLevel(), JFile\upload(), JFile\write(), et JClientFtp\write().


La documentation de cette classe a été générée à partir du fichier suivant :