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


PHP Logger::initialize方法代码示例

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


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

示例1: testConfigureWithEmptyIniFile

 public function testConfigureWithEmptyIniFile()
 {
     $catchedException = null;
     try {
         Logger::configure('configurators/test2.properties');
         Logger::initialize();
         self::assertTrue(false);
     } catch (LoggerException $e) {
         $catchedException = $e;
     }
     self::assertNotNull($catchedException);
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:12,代码来源:LoggerConfiguratorIniTest.php

示例2: 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

示例3: initialize

 /**
  * Initializes this logger.
  *
  * @param sfEventDispatcher $dispatcher A sfEventDispatcher instance
  * @param array             $options    An array of options.
  */
 public function initialize($options = array())
 {
     parent::initialize($options);
     if (!isset($options['file_name'])) {
         throw new StartupInitParamsExceptionException(get_class($this), 'file_name');
     }
     //        if (!isset($options['u_file_name']))
     //        {
     //            throw new StartupInitParamsExceptionException(get_class($this), 'u_file_name');
     //        }
     if (!isset($options['format'])) {
         throw new StartupInitParamsExceptionException(get_class($this), 'format');
     }
     if (!isset($options['inner_format'])) {
         throw new StartupInitParamsExceptionException(get_class($this), 'inner_format');
     }
     $this->format = $options['format'];
     $this->inner_format = $options['inner_format'];
     $this->file_name = ConfigManager::bind()->getBaseDir() . '/log/' . $options['file_name'];
     $this->u_file_name = ConfigManager::bind()->getBaseDir() . '/log/' . $options['u_file_name'];
     $this->event_dispatcher->connect('application.log_exception', array($this, 'ApplicationLogExceptionEventHandler'));
 }
开发者ID:nebtrx,项目名称:stratos,代码行数:28,代码来源:ExceptionLogger.class.php

示例4: testRenderer

 public function testRenderer()
 {
     Logger::configure('configurators/test4.properties');
     Logger::initialize();
     $hierarchy = Logger::getHierarchy();
     $map = $hierarchy->getRendererMap();
     $clazz = $map->getByClassName('Fruit');
     self::assertTrue($clazz instanceof FruitRenderer);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:9,代码来源:LoggerConfiguratorIniTest.php

示例5: testGetCurrentLoggers

 public function testGetCurrentLoggers()
 {
     Logger::clear();
     Logger::resetConfiguration();
     self::assertEquals(0, count(Logger::getCurrentLoggers()));
     Logger::configure('LoggerTest.properties');
     Logger::initialize();
     self::assertEquals(1, count(Logger::getCurrentLoggers()));
     $list = Logger::getCurrentLoggers();
     self::assertEquals('mylogger', $list[0]->getName());
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:11,代码来源:LoggerTest.php

示例6: initialize

 /**
  * Initializes this logger.
  *
  * @param sfEventDispatcher $dispatcher A sfEventDispatcher instance
  * @param array             $options    An array of options.
  */
 public function initialize($options = array())
 {
     parent::initialize($options);
     $this->event_dispatcher->connect('webbot.log', array($this, 'ConsoleLogEventHandler'));
 }
开发者ID:nebtrx,项目名称:stratos,代码行数:11,代码来源:ConsoleLogger.class.php

示例7: date_default_timezone_set

$define('APP_FAILED_LOGIN_BACKOFF_MINUTES', 15);
$define('APP_HIDE_CLOSED_STATS_COOKIE', 'eventum_hide_closed_stats');
// if set, normal calls to eventum are redirected to a maintenance page while
// requests to /manage/ still work
$define('APP_MAINTENANCE', false);
require_once APP_PATH . '/autoload.php';
// fix magic_quote_gpc'ed values
if (get_magic_quotes_gpc()) {
    $_GET = Misc::dispelMagicQuotes($_GET);
    $_POST = Misc::dispelMagicQuotes($_POST);
    $_REQUEST = Misc::dispelMagicQuotes($_REQUEST);
}
Misc::stripInput($_POST);
// set default timezone
date_default_timezone_set(APP_DEFAULT_TIMEZONE);
Logger::initialize();
Language::setup();
// set charset
header('Content-Type: text/html; charset=' . APP_CHARSET);
// display maintenance message if requested.
if (APP_MAINTENANCE) {
    $is_manage = strpos($_SERVER['PHP_SELF'], '/manage/') !== false;
    if (APP_MAINTENANCE && !$is_manage) {
        $tpl = new Template_Helper();
        $tpl->setTemplate("maintenance.tpl.html");
        $tpl->displayTemplate();
        exit(0);
    }
}
// Default IRC category
$define("APP_EVENTUM_IRC_CATEGORY_DEFAULT", "default");
开发者ID:dabielkabuto,项目名称:eventum,代码行数:31,代码来源:init.php

示例8: initialize

 /**
  * Initializes this logger.
  *
  * @param sfEventDispatcher $dispatcher A sfEventDispatcher instance
  * @param array             $options    An array of options.
  */
 public function initialize($options = array())
 {
     parent::initialize($options);
     $this->event_dispatcher->connect('webbot.log', array($this, 'WebbotLogEventHandler'));
     $this->event_dispatcher->connect('context.webbot_injected', array($this, 'ContextWebbotInjectedEventHandler'));
 }
开发者ID:nebtrx,项目名称:stratos,代码行数:12,代码来源:WebbotLogger.class.php


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