本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
}
示例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));
}
示例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);
}
示例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);
}
示例9: __construct
public function __construct($level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
{
$stream = "php://stderr";
parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
}
示例10: __construct
/**
* @param string $logDir
*/
public function __construct($logDir)
{
$this->logDir = $logDir;
parent::__construct(false);
}
示例11: __construct
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
{
parent::__construct($url, $level, $bubble);
$this->fileManager = new \Espo\Core\Utils\File\Manager();
}
示例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]);
}
示例13: __construct
public function __construct($level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
{
parent::__construct("php://output", $level, $bubble, $filePermission, $useLocking);
}
示例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);
}