当前位置: 首页>>代码示例>>PHP>>正文


PHP LoggerManager::getRootLogger方法代码示例

本文整理汇总了PHP中LoggerManager::getRootLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerManager::getRootLogger方法的具体用法?PHP LoggerManager::getRootLogger怎么用?PHP LoggerManager::getRootLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoggerManager的用法示例。


在下文中一共展示了LoggerManager::getRootLogger方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configure

 /**
  * Add a {@link LoggerAppenderConsole} that uses 
  * the {@link LoggerLayoutTTCC} to the root category.
  * 
  * @param string $url not used here
  */
 public static function configure($url = null)
 {
     $root = LoggerManager::getRootLogger();
     $appender = new LoggerAppenderConsole('A1');
     $appender->setLayout(new LoggerLayoutTTCC());
     $root->addAppender($appender);
 }
开发者ID:rrsc,项目名称:freemed,代码行数:13,代码来源:LoggerBasicConfigurator.php

示例2: configure

 /**
  * Add a {@link LoggerAppenderConsole} that uses 
  * the {@link LoggerLayoutTTCC} to the root category.
  * 
  * @param string $url not used here
  * @static  
  */
 function configure($url = null)
 {
     $root =& LoggerManager::getRootLogger();
     $appender =& LoggerAppender::singleton('A1', 'LoggerAppenderConsole');
     $layout = LoggerLayout::factory('LoggerLayoutTTCC');
     $appender->setLayout($layout);
     $root->addAppender($appender);
 }
开发者ID:roni5,项目名称:sela,代码行数:15,代码来源:LoggerBasicConfigurator.php

示例3: getRootLogger

 /**
  * get the Root Logger (Delegate to {@link LoggerManager})
  * @return LoggerRoot
  * @static 
  */
 public function getRootLogger()
 {
     return LoggerManager::getRootLogger();
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:9,代码来源:Logger.php

示例4:

 /**
  * Return the root of the default category hierrachy.
  * @return LoggerRoot
  */
 function &getRoot()
 {
     return LoggerManager::getRootLogger();
 }
开发者ID:Bobsel,项目名称:gn-tic,代码行数:8,代码来源:LoggerCategory.php

示例5: define

<?php

/** 
 *  
 * Author: Khurram Ijaz (khurram@renai-soft.com)
 * Company: Renaissance Software / Intellicomdevelopment.com (info@renai-soft.com)
 * All rights reserved.
 *
 *
 *  
 */
define('LOG4PHP_CONFIGURATION', $cfg['config_dir'] . '/log4php.properties');
$_ENV['LOGFILEPATH'] = $cfg['log_dir'] . '/log.txt';
require_once 'libs/log4php/LoggerManager.php';
$log =& LoggerManager::getRootLogger();
if (!$log) {
    echo 'no log';
    exit;
}
$log->info("Logging configured successfully.");
开发者ID:ar-mohammadi,项目名称:cwr_cwrdiversity.org,代码行数:20,代码来源:logger.php

示例6: tagOpen


//.........这里部分代码省略.........
                         } else {
                             LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LOGGER. " . "class '{$className}' doesnt implement 'getLogger()' method.");
                         }
                     }
                 }
                 if ($this->logger !== null and isset($attribs['ADDITIVITY'])) {
                     $additivity = LoggerOptionConverter::toBoolean($this->subst($attribs['ADDITIVITY']), true);
                     $this->logger->setAdditivity($additivity);
                 }
             } else {
                 LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LOGGER. Attribute 'name' is not set or is empty.");
             }
             $this->state[] = LOG4PHP_LOGGER_DOM_CONFIGURATOR_LOGGER_STATE;
             break;
         case 'LEVEL':
         case LOG4PHP_LOGGER_DOM_CONFIGURATOR_XMLNS . ':LEVEL':
         case 'PRIORITY':
         case LOG4PHP_LOGGER_DOM_CONFIGURATOR_XMLNS . ':PRIORITY':
             if (!isset($attribs['VALUE'])) {
                 LoggerLog::debug("LoggerDOMConfigurator::tagOpen() LEVEL value not set");
                 break;
             }
             LoggerLog::debug("LoggerDOMConfigurator::tagOpen() LEVEL value={$attribs['VALUE']}");
             if ($this->logger === null) {
                 LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LEVEL. parent logger is null");
                 break;
             }
             switch (end($this->state)) {
                 case LOG4PHP_LOGGER_DOM_CONFIGURATOR_ROOT_STATE:
                     $this->logger->setLevel(LoggerOptionConverter::toLevel($this->subst($attribs['VALUE']), $this->logger->getLevel()));
                     LoggerLog::debug("LoggerDOMConfigurator::tagOpen() LEVEL root level is now '{$attribs['VALUE']}' ");
                     break;
                 case LOG4PHP_LOGGER_DOM_CONFIGURATOR_LOGGER_STATE:
                     $this->logger->setLevel(LoggerOptionConverter::toLevel($this->subst($attribs['VALUE']), $this->logger->getLevel()));
                     break;
                 default:
                     LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LEVEL state '{$this->state}' not allowed here");
             }
             break;
         case 'PARAM':
         case LOG4PHP_LOGGER_DOM_CONFIGURATOR_XMLNS . ':PARAM':
             LoggerLog::debug("LoggerDOMConfigurator::tagOpen() PARAM");
             if (!isset($attribs['NAME'])) {
                 LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM. " . "attribute 'name' not defined.");
                 break;
             }
             if (!isset($attribs['VALUE'])) {
                 LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM. " . "attribute 'value' not defined.");
                 break;
             }
             switch (end($this->state)) {
                 case LOG4PHP_LOGGER_DOM_CONFIGURATOR_APPENDER_STATE:
                     if ($this->appender !== null) {
                         $this->setter($this->appender, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
                     } else {
                         LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM. " . " trying to set property to a null appender.");
                     }
                     break;
                 case LOG4PHP_LOGGER_DOM_CONFIGURATOR_LAYOUT_STATE:
                     if ($this->layout !== null) {
                         $this->setter($this->layout, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
                     } else {
                         LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM. " . " trying to set property to a null layout.");
                     }
                     break;
                 case LOG4PHP_LOGGER_DOM_CONFIGURATOR_FILTER_STATE:
                     if ($this->filter !== null) {
                         $this->setter($this->filter, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
                     } else {
                         LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM. " . " trying to set property to a null filter.");
                     }
                     break;
                 default:
                     LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM state '{$this->state}' not allowed here");
             }
             break;
         case 'RENDERER':
         case LOG4PHP_LOGGER_DOM_CONFIGURATOR_XMLNS . ':RENDERER':
             $renderedClass = $this->subst(@$attribs['RENDEREDCLASS']);
             $renderingClass = $this->subst(@$attribs['RENDERINGCLASS']);
             LoggerLog::debug("LoggerDOMConfigurator::tagOpen() RENDERER renderedClass='{$renderedClass}' renderingClass='{$renderingClass}'");
             if (!empty($renderedClass) and !empty($renderingClass)) {
                 $renderer = LoggerObjectRenderer::factory($renderingClass);
                 if ($renderer === null) {
                     LoggerLog::warn("LoggerDOMConfigurator::tagOpen() RENDERER cannot instantiate '{$renderingClass}'");
                 } else {
                     $this->repository->setRenderer($renderedClass, $renderer);
                 }
             } else {
                 LoggerLog::warn("LoggerDOMConfigurator::tagOpen() RENDERER renderedClass or renderingClass is empty");
             }
             break;
         case 'ROOT':
         case LOG4PHP_LOGGER_DOM_CONFIGURATOR_XMLNS . ':ROOT':
             LoggerLog::debug("LoggerDOMConfigurator::tagOpen() ROOT");
             $this->logger =& LoggerManager::getRootLogger();
             $this->state[] = LOG4PHP_LOGGER_DOM_CONFIGURATOR_ROOT_STATE;
             break;
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:101,代码来源:LoggerDOMConfigurator.php


注:本文中的LoggerManager::getRootLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。