add custom settings
This commit is contained in:
parent
8c693ec00c
commit
24ba3bdb26
1 changed files with 17 additions and 0 deletions
|
|
@ -27,8 +27,15 @@ class LogWriterFile extends LogWriter
|
|||
* @throws Exception
|
||||
*/
|
||||
public function __construct(array $options = []) {
|
||||
|
||||
parent::__construct($options);
|
||||
|
||||
$logFileSize = (int) getEffectiveSetting('log', 'writer-file-size-' . basename($this->getOption('destination')), $this->getOption('logFileSize') ?? 0);
|
||||
|
||||
if($logFileSize > 0) {
|
||||
$this->maxLogFileSize = $logFileSize;
|
||||
}
|
||||
|
||||
$this->createHandle();
|
||||
}
|
||||
|
||||
|
|
@ -115,4 +122,14 @@ class LogWriterFile extends LogWriter
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getMaxLogFileSize(): int
|
||||
{
|
||||
return $this->maxLogFileSize;
|
||||
}
|
||||
|
||||
public function setMaxLogFileSize(int $maxLogFileSize): void
|
||||
{
|
||||
$this->maxLogFileSize = $maxLogFileSize;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue