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