diff --git a/include/logging.php b/include/logging.php index af6ca6578ddda65201c5b1816dd4bb5f1bb5c896..65f2c7b61ceb199e5a1fae21e2b22ef73ea4d8ea 100644 --- a/include/logging.php +++ b/include/logging.php @@ -22,20 +22,20 @@ require_once('config.php'); // Performance Optimization: Configure the log folder @include_once('config.performance.php'); global $PERFORMANCE_CONFIG; + +define('LOG4PHP_DEFAULT_INIT_OVERRIDE', true); + if(isset($PERFORMANCE_CONFIG) && isset($PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) && $PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) { define('LOG4PHP_DIR', 'libraries/log4php.debug'); + require_once(LOG4PHP_DIR.'/Logger.php'); + Logger::configure('log4php.properties'); } else { define('LOG4PHP_DIR', 'libraries/log4php'); + require_once(LOG4PHP_DIR.'/Logger.php'); + require_once(LOG4PHP_DIR.'/LoggerPropertyConfigurator.php'); + + $config = new LoggerPropertyConfigurator(); + $config->configure('log4php.properties'); } // END -define('LOG4PHP_DEFAULT_INIT_OVERRIDE', true); - -require_once(LOG4PHP_DIR.'/Logger.php'); -//require_once(LOG4PHP_DIR.'/LoggerPropertyConfigurator.php'); -// -//$config = new LoggerPropertyConfigurator(); -//$config->configure('log4php.properties'); -Logger::configure('log4php.properties'); - - ?> \ No newline at end of file diff --git a/libraries/log4php/LoggerManager.php b/libraries/log4php/Logger.php similarity index 97% rename from libraries/log4php/LoggerManager.php rename to libraries/log4php/Logger.php index f5a0ec9df64f06359a73e3cdf4d974332e2fa09d..042c7b0541d1fe45b61e3533c8fcfc6a6b1b05e6 100644 --- a/libraries/log4php/LoggerManager.php +++ b/libraries/log4php/Logger.php @@ -10,13 +10,6 @@ /** Classes to avoid logging */ -class LoggerManager { - static function getlogger($name = 'ROOT') { - $configinfo = LoggerPropertyConfigurator::getInstance()->getConfigInfo($name); - return new Logger($name, $configinfo); - } -} - /** * Core logging class. */ @@ -101,6 +94,11 @@ class Logger { function isDebugEnabled() { return $this->isLevelEnabled('DEBUG'); } + + static function getlogger($name = 'ROOT') { + $configinfo = LoggerPropertyConfigurator::getInstance()->getConfigInfo($name); + return new Logger($name, $configinfo); + } } /**