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


PHP Logger::configure方法代码示例

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


在下文中一共展示了Logger::configure方法的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: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     date_default_timezone_set(DATE_ZONE);
     Logger::configure(LOG_ERROR);
     $this->_logger = Logger::getLogger(__CLASS__);
 }
开发者ID:jquedena,项目名称:explora-titania,代码行数:7,代码来源:ErrorController.php

示例4: __construct

 function __construct($jsonPath)
 {
     include $this->loggerPath;
     Logger::configure($this->loggerConfigPath);
     $this->logger = Logger::getLogger("main");
     $this->jsonFilePath = $jsonPath;
 }
开发者ID:gudbrandtandberg,项目名称:Asperoy,代码行数:7,代码来源:JSON_CRUD.php

示例5: lib_log4php_load

/**
 * Loads the log4php library.
 */
function lib_log4php_load()
{
    require LIB_LOG4PHP_PATH . '/Logger.php';
    // start logging
    Logger::configure(LIB_LOG4PHP_CONFIGFILE_PATH);
    $logger = Logger::getLogger('system.libs.log4php');
    $logger->info('log4php started');
}
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:11,代码来源:log4php.php

示例6: setup

 public function setup()
 {
     // for compatibility / remove and enable only the plugins you want
     $this->enableAllPluginsExcept(array());
     // Set up logging - use different config for test environment
     $logConfig = sfConfig::get('sf_environment') == 'test' ? 'log4php_test.properties' : 'log4php.properties';
     Logger::configure(dirname(__FILE__) . '/' . $logConfig, 'OrangeHRMLogConfigurator');
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:8,代码来源:ProjectConfiguration.class.php

示例7: __construct

 public function __construct($logger = 'default')
 {
     $pathXML = LIB . DS . 'log' . DS . 'config.xml';
     $configurator = new LoggerConfiguratorDefault();
     $config = $configurator->parse($pathXML);
     Logger::configure($config);
     $this->logger = Logger::getLogger($logger);
 }
开发者ID:jjaferson,项目名称:ourives,代码行数:8,代码来源:Logger4PHP.php

示例8: configure

 /**
  * Configures log4php and the PHP error & exception handlers
  * to log all errors and exceptions through log4php.
  *
  * @param string $log4phpConfiguration
  *            the log4php configuration filename
  */
 public static final function configure($log4phpConfiguration)
 {
     \Logger::configure($log4phpConfiguration);
     set_error_handler('\\PHPYAM\\libs\\LoggerUtils::errorHandler');
     set_exception_handler('\\PHPYAM\\libs\\LoggerUtils::exceptionHandler');
     // TODO: add register_shutdown_function() for non-catchable errors?
     // http://phpfunk.com/php/capture-fatal-php-errors-for-logging/
 }
开发者ID:tbl0605,项目名称:PHPYAM,代码行数:15,代码来源:LoggerUtils.php

示例9: __construct

 public function __construct()
 {
     date_default_timezone_set(DATE_ZONE);
     Logger::configure(LOG_ERROR);
     $this->logger = Logger::getLogger(__CLASS__);
     $this->logger->debug("Inicializando la base de datos.");
     $this->initDB();
 }
开发者ID:jquedena,项目名称:explora-titania,代码行数:8,代码来源:DataAdapter.php

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

示例11: __construct

 public final function __construct()
 {
     \Logger::configure("..\\config\\logger.xml");
     $this->log = \Logger::getLogger(__CLASS__);
     /** @var $this->Session Session */
     $this->Session = \src\singleton\Session::inst();
     $this->Session->Start();
     $this->RenderPage();
 }
开发者ID:Waryway,项目名称:Website,代码行数:9,代码来源:Page.php

示例12: __construct

 /**
  * 初始化Log4php
  */
 public function __construct()
 {
     $config =& get_config();
     if (is_numeric($config['log_threshold'])) {
         $this->_threshold = $config['log_threshold'];
     }
     require_once LOG4PHP_PATH . 'Logger.php';
     Logger::configure(APPPATH . 'config/log_dailyfile.xml');
 }
开发者ID:shaoyi88,项目名称:admin_template,代码行数:12,代码来源:APP_Log.php

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

示例14: init

 public static function init()
 {
     if (self::$_initialized === TRUE) {
         return;
     }
     Logger::configure(__DIR__ . '/../config/log4php/config.xml');
     self::$_log = Logger::getLogger(__CLASS__);
     self::$_initialized = TRUE;
 }
开发者ID:Halayem,项目名称:ANYEM,代码行数:9,代码来源:ClientImpl.php

示例15: __construct

 private function __construct()
 {
     $this->logger = new NullLog4php();
     $this->sqlLogger = new NullLog4php();
     if (file_exists($f = ROOT_DIR . 'config/log4php.config.xml')) {
         Logger::configure($f);
         $this->logger = Logger::getLogger('default');
         $this->sqlLogger = Logger::getLogger('sql');
     }
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:10,代码来源:Log.php


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