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


PHP Logger::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     if ($options instanceof \Traversable) {
         $options = ArrayUtils::iteratorToArray($options);
     }
     if (is_array($options)) {
         if (!empty($options['stream'])) {
             if (!is_array($options['stream'])) {
                 $options['stream'] = ['uri' => $options['stream']];
             }
             if (!empty($options['stream']['uri'])) {
                 $writer = new Stream($options['stream']['uri']);
                 if (!empty($options['stream']['priority'])) {
                     $filter = new Priority($options['stream']['priority']);
                     $writer->addFilter($filter);
                 }
                 $this->addWriter($writer);
             }
         }
         if (!empty($options['slack'])) {
             $writer = new SlackWriter($options['slack']);
             $this->addWriter($writer);
         }
         if (!empty($options['register_error_handler'])) {
             Logger::registerErrorHandler($this);
         }
         if (!empty($options['register_exception_handler'])) {
             Logger::registerExceptionHandler($this);
         }
     }
 }
开发者ID:Mailclark,项目名称:bot2hook,代码行数:32,代码来源:Logger.php

示例2: __construct

 public function __construct(array $options = [])
 {
     if (isset($options['name'])) {
         $this->name = $options['name'];
         unset($optiona['name']);
     }
     parent::__construct();
 }
开发者ID:railsphp,项目名称:railsphp,代码行数:8,代码来源:Logger.php

示例3: __construct

 /**
  * Construtor.
  *
  * Sets the logDir, logFile and thr writer. If the logDir is null, the system's temp dir will be used
  *
  * @param string $logFile
  * @param string $logDir
  */
 public function __construct($logFile, $logDir = null)
 {
     parent::__construct();
     if (null === $logDir) {
         $logDir = sys_get_temp_dir();
     }
     $this->setLogDir($logDir);
     $this->setLogFile($logFile);
     $writer = new Stream($logDir . DIRECTORY_SEPARATOR . $logFile);
     $this->addWriter($writer);
 }
开发者ID:lafaiDev,项目名称:suive_com,代码行数:19,代码来源:AbstractLogger.php

示例4: __construct

 public function __construct($options = null, $authService)
 {
     $defaultExtra = array('sessionId' => session_id(), 'host' => !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'CLI', 'path' => !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 'ip' => !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'unavailable');
     if ($authService && $authService->hasIdentity()) {
         $identity = $authService->getIdentity();
         $userID = null;
         if (method_exists($identity, 'getId')) {
             $userID = $identity->getID();
         } elseif (property_exists($identity, 'getId')) {
             $userID = $identity['getId'];
         }
         if ($userID) {
             $defaultExtra['user'] = $userID;
         }
     }
     $this->setDefaultExtra($defaultExtra);
     parent::__construct($options);
 }
开发者ID:vcomedia,项目名称:vco-zf-logger,代码行数:18,代码来源:Logger.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->formatter = new Logstash();
 }
开发者ID:netsensia,项目名称:opg-lpa-logger,代码行数:5,代码来源:Logger.php

示例6: __construct

 /**
  * Accepted option keys:
  *   writers: array of writers to add to this record service (keys: name [, priority][, options])
  *   processors: array of processors to add to this record service (keys: name [, priority][, options])
  *   exceptionhandler: if true register this record service as exceptionhandler
  *   errorhandler: if true register this record service as errorhandler
  *   fatal_error_shutdownfunction: if true register this record service as fatal error shutdown
  * @param array|Traversable|null $options
  * @throws Exception\InvalidArgumentException
  */
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->priorities = array_replace($this->priorities, $this->gz3Priorities);
 }
开发者ID:geolysis,项目名称:gz3-base,代码行数:15,代码来源:RecordService.php

示例7: __construct

 public function __construct(Translator $translator, $options = null)
 {
     $this->translator = $translator;
     parent::__construct($options);
 }
开发者ID:anukat2015,项目名称:xmlps,代码行数:5,代码来源:Logger.php


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