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


PHP Logger::getRootLogger方法代码示例

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


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

示例1: testThreshold

 public function testThreshold()
 {
     Logger::configure('configurators/test1.xml');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
     $appender = $root->getAppender("blub");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelInfo();
     self::assertEquals($e, $threshold);
     $filter = $appender->getFilter();
     self::assertTrue($filter instanceof LoggerFilterLevelRange);
     $filter2 = $filter->getNext();
     self::assertTrue($filter2 instanceof LoggerFilterDenyAll);
     $threshold = Logger::getHierarchy()->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
     $hierarchy = Logger::getHierarchy();
     $map = $hierarchy->getRendererMap();
     $clazz = $map->getByClassName('Fruit2');
     self::assertTrue($clazz instanceof FruitRenderer2);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:34,代码来源:LoggerConfiguratorXmlTest.php

示例2: get_logger

function get_logger()
{
    require_once EZBOSS_THIRDPARTY_PATH . '/Apache/log4php/Logger.php';
    Logger::configure(EZBOSS_WEBROOT . '/config/appender_dailyfile.properties');
    $logger = Logger::getRootLogger();
    return $logger;
}
开发者ID:BGCX067,项目名称:ezboss-svn-to-git,代码行数:7,代码来源:common.func.php

示例3: getBufferAppender

 public static function getBufferAppender()
 {
     $appender = \Logger::getRootLogger()->getAppender('appenderBuffer');
     if (!$appender) {
         $appender = new LoggerAppenderBuffer();
     }
     return $appender;
 }
开发者ID:unkerror,项目名称:Budabot,代码行数:8,代码来源:RootController.php

示例4: __construct

 public function __construct()
 {
     session_start();
     ob_start("ob_gzhandler");
     date_default_timezone_set("UTC");
     $this->logger = Logger::getRootLogger();
     $this->logger->debug("Controller Constructor function");
     $this->data["request"] = $_REQUEST;
 }
开发者ID:indra012patel,项目名称:gventure_framework,代码行数:9,代码来源:Controller.php

示例5: getLogger

 protected function getLogger()
 {
     if (null == $this->_logger) {
         $logfile = self::$_logname . "log.xml";
         Logger::configure(CONF_PATH . DIRECTORY_SEPARATOR . $logfile);
         $this->_logger = Logger::getRootLogger();
     }
     return $this->_logger;
 }
开发者ID:haitao1880,项目名称:study,代码行数:9,代码来源:XLogger.php

示例6: initialize_logger

function initialize_logger($name)
{
    if (!IN_DEBUG) {
        return;
    }
    global $logger;
    Logger::configure(array('rootLogger' => array('appenders' => array('default')), 'appenders' => array('default' => array('class' => 'LoggerAppenderRollingFile', 'layout' => array('class' => 'LoggerLayoutPattern', "params" => array("ConversionPattern" => "%d{ISO8601} [%p] %m (at %F line %L)%n")), 'params' => array('file' => join_paths(QWP_LOG_DIR, $name . '.log'), 'append' => true, 'MaxFileSize' => '10MB', 'MaxBackupIndex' => '3')))));
    $logger = Logger::getRootLogger();
}
开发者ID:steem,项目名称:qwp,代码行数:9,代码来源:logger.php

示例7: testAppendStderr

 public function testAppendStderr()
 {
     $this->config['appenders']['default']['params']['target'] = 'stderr';
     Logger::configure($this->config);
     $log = Logger::getRootLogger();
     $expected = LoggerAppenderConsole::STDERR;
     $actual = $log->getAppender('default')->getTarget();
     $this->assertSame($expected, $actual);
     $log->info("hello");
 }
开发者ID:brennantom,项目名称:hackazon,代码行数:10,代码来源:LoggerAppenderConsoleTest.php

示例8: _initLogger

 public function _initLogger()
 {
     require_once APPLICATION_PATH . "/application/library/Log/Logger.php";
     Logger::configure(APPLICATION_PATH . "/conf/logconf.php");
     $logger = Logger::getRootLogger();
     Yaf_Registry::set('logger', $logger);
     // Logger::configure(APPLICATION_PATH . "/conf/statlogconf.php");
     // $statLogger = Logger::getRootLogger();
     // Yaf_Registry::set('statLogger', $statLogger);
 }
开发者ID:Genffy,项目名称:calculate,代码行数:10,代码来源:Bootstrap.php

示例9: testIsEnabledFor

 public function testIsEnabledFor()
 {
     Logger::configure('LoggerTest.properties');
     $logger = Logger::getLogger('mylogger');
     self::assertTrue($logger->isDebugEnabled());
     self::assertTrue($logger->isInfoEnabled());
     $logger = Logger::getRootLogger();
     self::assertFalse($logger->isDebugEnabled());
     self::assertFalse($logger->isInfoEnabled());
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:10,代码来源:LoggerTest.php

示例10: testConfigureWithRootCategory

 public function testConfigureWithRootCategory()
 {
     Logger::configure('configurators/test3.properties');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:10,代码来源:LoggerConfiguratorIniTest.php

示例11: testConfigure

 public function testConfigure()
 {
     Logger::configure('configurators/test1.php', 'LoggerConfiguratorPhp');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $logger = Logger::getLogger('mylogger');
     self::assertEquals(LoggerLevel::getLevelInfo(), $logger->getLevel());
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:12,代码来源:LoggerConfiguratorPhpTest.php

示例12: testUsage

 public function testUsage()
 {
     Logger::resetConfiguration();
     Logger::configure(dirname(__FILE__) . '/test4.properties');
     $logger = Logger::getRootLogger();
     ob_start();
     $logger->warn(new Fruit3());
     $actual = ob_get_contents();
     ob_end_clean();
     $expected = "WARN - test1,test2,test3" . PHP_EOL;
     self::assertEquals($expected, $actual);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:12,代码来源:LoggerRendererMapTest.php

示例13: testUsage

 public function testUsage()
 {
     Logger::resetConfiguration();
     Logger::configure(dirname(__FILE__) . '/test4.properties');
     Logger::initialize();
     $logger = Logger::getRootLogger();
     ob_start();
     $logger->error(new Fruit3());
     $v = ob_get_contents();
     ob_end_clean();
     self::assertEquals("ERROR - test1,test2,test3\n", $v);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:12,代码来源:LoggerRendererMapTest.php

示例14: testHtmlLineBreaks

 public function testHtmlLineBreaks()
 {
     Logger::configure($this->config2);
     $log = Logger::getRootLogger();
     $hlb = $log->getAppender('default')->getHtmlLineBreaks();
     $this->assertSame(true, $hlb);
     ob_start();
     $log->info("This is a test" . PHP_EOL . "With more than one line");
     $log->debug("And this too");
     $actual = ob_get_clean();
     $expected = "INFO - This is a test<br />" . PHP_EOL . "With more than one line<br />" . PHP_EOL . "DEBUG - And this too<br />" . PHP_EOL;
     $this->assertSame($expected, $actual);
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:13,代码来源:LoggerAppenderEchoTest.php

示例15: sendSMS

 private function sendSMS($http, $uid, $pwd, $mobile, $content, $mobileids, $time = '', $mid = '')
 {
     $data = array('uid' => $uid, 'pwd' => md5($pwd . $uid), 'mobile' => $mobile, 'content' => $content, 'mobileids' => $mobileids, 'time' => $time);
     $re = $this->postSMS($http, $data);
     //POST方式提交
     //if( trim($re) == '100' )
     if (trim($re) == 'sms&stat=100&message=发送成功') {
         Logger::getRootLogger()->debug("Sms:发送成功");
         return 0;
     } else {
         Logger::getRootLogger()->debug("发送失败! 状态:" . $re);
         return 1;
     }
 }
开发者ID:nightmarehelen,项目名称:dalaba,代码行数:14,代码来源:Sms.php


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