This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).
*Design, strategies and part of the methods documentation are developed by log4j team * (Ceki Gülcü as log4j project founder and * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).
* *PHP port, extensions and modifications by VxR. All rights reserved.
* For more information, please see {@link http://www.vxr.it/log4php/}.
This software is published under the terms of the LGPL License * a copy of which has been included with this distribution in the LICENSE file.
* * @package log4php */ /** * LOG4PHP_DIR points to the log4php root directory. * * If not defined it will be set automatically when the first package classfile * is included * * @var string */ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__)); require_once(LOG4PHP_DIR . '/LoggerHierarchy.php'); /** * Use the LoggerManager to get Logger instances. * * @author VxRIf it is not user defined, log4php tries to autoconfigure using (in order):
* * - the$_ENV['log4php.defaultInitOverride']
variable.
* - the $GLOBALS['log4php.defaultInitOverride']
global variable.
* - defaults to false
*
* @var boolean
*/
define('LOG4PHP_DEFAULT_INIT_OVERRIDE', false);
}
}
if (!defined('LOG4PHP_CONFIGURATION')) {
if (isset($_ENV['log4php.configuration'])) {
/**
* @ignore
*/
define('LOG4PHP_CONFIGURATION', trim($_ENV['log4php.configuration']));
} else {
/**
* Configuration file.
*
* This constant tells configurator classes where the configuration * file is located.
*If not set by user, log4php tries to set it automatically using * (in order):
* * - the$_ENV['log4php.configuration']
enviroment variable.
* - defaults to 'log4php.properties'.
*
* @var string
*/
define('LOG4PHP_CONFIGURATION', 'log4php.properties');
}
}
if (!defined('LOG4PHP_CONFIGURATOR_CLASS')) {
if ( strtolower(substr( LOG4PHP_CONFIGURATION, -4 )) == '.xml') {
/**
* @ignore
*/
define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR . '/xml/LoggerDOMConfigurator');
} else {
/**
* Holds the configurator class name.
*
* This constant is set with the fullname (path included but non the * .php extension) of the configurator class that init procedure will use.
*If not set by user, log4php tries to set it automatically.
*If {@link LOG4PHP_CONFIGURATION} has '.xml' extension set the * constants to '{@link LOG4PHP_DIR}/xml/{@link LoggerDOMConfigurator}'.
*Otherwise set the constants to * '{@link LOG4PHP_DIR}/{@link LoggerPropertyConfigurator}'.
* *Security Note: classfile pointed by this constant will be brutally
* included with a:
* @include_once(LOG4PHP_CONFIGURATOR_CLASS . ".php");
This procedure tries to configure the {@link LoggerHierarchy} using the * configurator class defined via {@link LOG4PHP_CONFIGURATOR_CLASS} that tries * to load the configurator file defined in {@link LOG4PHP_CONFIGURATION}. * If something goes wrong a warn is raised.
*Users can skip this procedure using {@link LOG4PHP_DEFAULT_INIT_OVERRIDE} * constant.
* * @return boolean */ function LoggerManagerDefaultInit() { $configuratorClass = basename(LOG4PHP_CONFIGURATOR_CLASS); if (!class_exists($configuratorClass)) { @include_once(LOG4PHP_CONFIGURATOR_CLASS . ".php"); } if (class_exists($configuratorClass)) { return call_user_func(array($configuratorClass, 'configure'), LOG4PHP_CONFIGURATION); } else { LoggerLog::warn("LoggerManagerDefaultInit() Configurator '{$configuratorClass}' doesnt exists"); return false; } } ?>