本文整理汇总了PHP中LoggerManager::getLoggerRepository方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerManager::getLoggerRepository方法的具体用法?PHP LoggerManager::getLoggerRepository怎么用?PHP LoggerManager::getLoggerRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerManager
的用法示例。
在下文中一共展示了LoggerManager::getLoggerRepository方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* Configure the default repository using the resource pointed by <b>url</b>.
* <b>Url</b> is any valid resurce as defined in {@link PHP_MANUAL#file} function.
* Note that the resource will be search with <i>use_include_path</i> parameter
* set to "1".
*
* @param string $url
* @return boolean configuration result
* @static
*/
function configure($url = '')
{
$configurator = new LoggerPropertyConfigurator();
$repository =& LoggerManager::getLoggerRepository();
return $configurator->doConfigure($url, $repository);
}
示例2: getDefaultHierarchy
/**
* Please use {@link LoggerManager::getLoggerRepository()} instead.
* @deprecated
*/
public function getDefaultHierarchy()
{
return LoggerManager::getLoggerRepository();
}
示例3: setupLogging
function setupLogging()
{
global $default;
$oKTConfig =& KTConfig::getSingleton();
if (!defined('APP_NAME')) {
define('APP_NAME', $oKTConfig->get('ui/appName', 'KnowledgeTree'));
}
define('KT_LOG4PHP_DIR', KT_DIR . '/thirdparty/apache-log4php/src/main/php' . DIRECTORY_SEPARATOR);
define('LOG4PHP_CONFIGURATION', KT_DIR . '/config/ktlog.ini');
define('LOG4PHP_DEFAULT_INIT_OVERRIDE', true);
require_once KT_LOG4PHP_DIR . 'LoggerManager.php';
require_once KT_LOG4PHP_DIR . 'LoggerPropertyConfigurator.php';
$configurator = new LoggerPropertyConfigurator();
$repository = LoggerManager::getLoggerRepository();
$properties = @parse_ini_file(LOG4PHP_CONFIGURATION);
$properties['log4php.appender.default'] = 'LoggerAppenderDailyFile';
$properties['log4php.appender.default.layout'] = 'LoggerPatternLayout';
$properties['log4php.appender.default.layout.conversionPattern'] = '%d{Y-m-d | H:i:s} | %p | %t | %r | %X{userid} | %X{db} | %c | %M | %m%n';
$properties['log4php.appender.default.datePattern'] = 'Y-m-d';
$logDir = $oKTConfig->get('urls/logDirectory');
$properties['log4php.appender.default.file'] = $logDir . '/kt%s.' . KTUtil::running_user() . '.log.txt';
// get the log level set in the configuration settings to override the level set in ktlog.ini
// for the default / main logging. Additional logging can be configured through the ini file
$logLevel = $oKTConfig->get('KnowledgeTree/logLevel');
$properties['log4php.rootLogger'] = $logLevel . ', default';
session_start();
$configurator->doConfigureProperties($properties, $repository);
$userId = isset($_SESSION['userID']) ? $_SESSION['userID'] : 'n/a';
LoggerMDC::put('userid', $userId);
LoggerMDC::put('db', $oKTConfig->get('db/dbName'));
$default->log = LoggerManager::getLogger('default');
$default->queryLog = LoggerManager::getLogger('sql');
$default->timerLog = LoggerManager::getLogger('timer');
$default->phpErrorLog = LoggerManager::getLogger('php');
}
示例4: shutdown
/**
* Safely close all appenders.
* @static
*/
function shutdown()
{
$repository =& LoggerManager::getLoggerRepository();
return $repository->shutdown();
}
示例5: configure
/**
* Configure the default repository using the resource pointed by <b>url</b>.
* <b>Url</b> is any valid resource as defined in {@link PHP_MANUAL#file} function.
* Note that the resource will be search with <i>use_include_path</i> parameter
* set to "1".
*
* @param string $url
* @static
*/
public static function configure($url = '')
{
$configurator = new LoggerDOMConfigurator();
$repository =& LoggerManager::getLoggerRepository();
return $configurator->doConfigure($url, $repository);
}
示例6: getRenderedMessage
/**
* Render message.
* @return string
*/
function getRenderedMessage()
{
if ($this->renderedMessage === null and $this->message !== null) {
if (is_string($this->message)) {
$this->renderedMessage = $this->message;
} else {
if ($this->logger !== null) {
$repository =& $this->logger->getLoggerRepository();
} else {
$repository =& LoggerManager::getLoggerRepository();
}
if (method_exists($repository, 'getrenderermap')) {
$rendererMap =& $repository->getRendererMap();
$this->renderedMessage = $rendererMap->findAndRender($this->message);
} else {
$this->renderedMessage = (string) $this->message;
}
}
}
return $this->renderedMessage;
}