1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

option to set file permissions in rotatingFileHandler

This commit is contained in:
Pankaj Garg
2014-03-26 13:09:02 +05:30
parent 98b2d0ba0a
commit b2e2530406
2 changed files with 14 additions and 8 deletions

View File

@@ -33,11 +33,12 @@ class RotatingFileHandler extends StreamHandler
/**
* @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
* @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
* @param int $filePermissions optional file permissions (default (0644) are only for owner read/write)
*/
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true)
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = 0644)
{
$this->filename = $filename;
$this->maxFiles = (int) $maxFiles;
@@ -45,7 +46,7 @@ class RotatingFileHandler extends StreamHandler
$this->filenameFormat = '{filename}-{date}';
$this->dateFormat = 'Y-m-d';
parent::__construct($this->getTimedFilename(), $level, $bubble);
parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission);
}
/**