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


PHP StreamHandler::__construct方法代码示例

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


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

示例1: __construct

 /**
  * @param string  $filename
  * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
  * @param integer $level    The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble   Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true)
 {
     $this->filename = $filename;
     $this->maxFiles = (int) $maxFiles;
     $this->nextRotation = new \DateTime('tomorrow');
     parent::__construct($this->getTimedFilename(), $level, $bubble);
 }
开发者ID:carlyns,项目名称:RESUSblog,代码行数:13,代码来源:RotatingFileHandler.php

示例2: __construct

 /**
  * @param string $stream
  * @param bool|int $level
  * @param string|null $channel
  * @param bool $bubble
  */
 public function __construct($stream, $level = Logger::DEBUG, $channel = null, $bubble = true)
 {
     parent::__construct($stream, $level, $bubble);
     $formatter = new Formatter(null, null, false, true);
     $this->setFormatter($formatter);
     $this->channel = $channel;
 }
开发者ID:brainexe,项目名称:core,代码行数:13,代码来源:ChannelStreamHandler.php

示例3: __construct

 /**
  * @param int $level [optional] The minimum logging level at which this
  *        handler will be triggered.
  * @param Boolean $bubble [optional] Whether the messages that are handled
  *        can bubble up the stack or not.
  * @param int|null $filePermission [optional] Optional file permissions
  *        (default (0640) are only for owner read/write).
  * @param Boolean $useLocking [optional] Try to lock log file before doing
  *        any writes.
  * @param resource|string|null $stream [optional]
  */
 public function __construct($level = Logger::INFO, $bubble = true, $filePermission = 0640, $useLocking = false, $stream = null)
 {
     if ($stream === null) {
         $pid = posix_getpid();
         $stream = "file:///var/log/app_engine/app.{$pid}.json";
     }
     parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
 }
开发者ID:GoogleCloudPlatform,项目名称:gcloud-php,代码行数:19,代码来源:AppEngineFlexHandler.php

示例4: __construct

 /**
  * @param string   $filename
  * @param int      $maxFiles       The maximal amount of files to keep (0 means unlimited)
  * @param int      $level          The minimum logging level at which this handler will be triggered
  * @param Boolean  $bubble         Whether the messages that are handled can bubble up the stack or not
  * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
  * @param Boolean  $useLocking     Try to lock log file before doing any writes
  */
 public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
 {
     $this->filename = $filename;
     $this->maxFiles = (int) $maxFiles;
     $this->nextRotation = new \DateTimeImmutable('tomorrow');
     $this->filenameFormat = '{filename}-{date}';
     $this->dateFormat = 'Y-m-d';
     parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking);
 }
开发者ID:earncef,项目名称:monolog,代码行数:17,代码来源:RotatingFileHandler.php

示例5: __construct

 /**
  * initialise Haymetric with log file
  * @param String  $filename     path to file which haymetric will write to
  * @param enum Rotations  $rotation rotation configuration, default is HOURLY
  * @param boolean $overridePermission override log folder permission if necessary, should not be use for production
  * @param int  $timestamp          timestamp
  */
 public function __construct($filename, $rotation = Rotations::HOURLY, $overridePermission = false, $timestamp = null)
 {
     $this->filename = $filename;
     $this->filenameFormat = '{filename}.{date}';
     $this->dateFormat = $this->dateFormat($rotation);
     $this->rotation = $rotation;
     parent::__construct($this->getTimedFilename($timestamp), Logger::INFO, true, 0644, false);
     if ($overridePermission) {
         $this->createDir();
     }
 }
开发者ID:haymetric,项目名称:haymetric-sdk-php,代码行数:18,代码来源:HaymetricStreamHandler.php

示例6: __construct

 /**
  * @param DriverInterface $filesystem
  * @param string $filePath
  */
 public function __construct(
     DriverInterface $filesystem,
     $filePath = null
 ) {
     $this->filesystem = $filesystem;
     parent::__construct(
         $filePath ? $filePath . $this->fileName : BP . $this->fileName,
         $this->loggerType
     );
     $this->setFormatter(new LineFormatter(null, null, true));
 }
开发者ID:robbiereynolds,项目名称:magento2,代码行数:15,代码来源:Base.php

示例7: __construct

 /**
  * @param string $filename
  * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
  * @param integer $level
  * @param Boolean $bubble
  */
 public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true)
 {
     $this->filename = $filename;
     $this->maxFiles = (int) $maxFiles;
     $fileInfo = pathinfo($this->filename);
     $timedFilename = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '-' . date('Y-m-d');
     if (!empty($fileInfo['extension'])) {
         $timedFilename .= '.' . $fileInfo['extension'];
     }
     // disable rotation upfront if files are unlimited
     if (0 === $this->maxFiles) {
         $this->mustRotate = false;
     }
     parent::__construct($timedFilename, $level, $bubble);
 }
开发者ID:nickaggarwal,项目名称:sample-symfony2,代码行数:21,代码来源:RotatingFileHandler.php

示例8: __construct

 /**
  * @param resource|string $stream
  * @param array         $config
  * @param Boolean         $bubble         Whether the messages that are handled can bubble up the stack or not
  * @param int|null        $filePermission Optional file permissions (default (0644) are only for owner read/write)
  * @param Boolean         $useLocking     Try to lock log file before doing any writes
  *
  * @throws \InvalidArgumentException If stream is not a resource or string
  */
 public function __construct($stream, $config, $bubble = true, $filePermission = null, $useLocking = false)
 {
     $level = $config && is_array($config) && !empty($config['logging_level']) ? $config['logging_level'] : Logger::ERROR;
     parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
 }
开发者ID:avtonom,项目名称:media-storage-client-bundle,代码行数:14,代码来源:MonologStreamHandler.php

示例9: __construct

 public function __construct($level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
 {
     $stream = "php://stderr";
     parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
 }
开发者ID:chatbox-inc,项目名称:lumen-providers,代码行数:5,代码来源:StderrHandler.php

示例10: __construct

 /**
  * @param string $logDir
  */
 public function __construct($logDir)
 {
     $this->logDir = $logDir;
     parent::__construct(false);
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:8,代码来源:BatchLogHandler.php

示例11: __construct

 public function __construct($url, $level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct($url, $level, $bubble);
     $this->fileManager = new \Espo\Core\Utils\File\Manager();
 }
开发者ID:mehulsbhatt,项目名称:espocrm,代码行数:5,代码来源:StreamHandler.php

示例12: __construct

 /**
  * @param string  $stream
  * @param integer $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct(array $params)
 {
     parent::__construct($params[0], $params[1], $params[2]);
 }
开发者ID:lunnlew,项目名称:Norma_Code,代码行数:9,代码来源:SAEStreamHandler.php

示例13: __construct

 public function __construct($level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
 {
     parent::__construct("php://output", $level, $bubble, $filePermission, $useLocking);
 }
开发者ID:lajosbencz,项目名称:otp-simple-lib,代码行数:4,代码来源:Html.php

示例14: __construct

 /**
  * @param integer $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct($level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct('php://stdout', $level, $bubble);
 }
开发者ID:kmelia,项目名称:monolog-stdout-handler,代码行数:8,代码来源:StdoutHandler.php


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