add custom settings

Dieser Commit ist enthalten in:
o.pinke 2024-03-12 19:05:19 +01:00
Ursprung 8c693ec00c
Commit 24ba3bdb26

Datei anzeigen

@ -27,8 +27,15 @@ class LogWriterFile extends LogWriter
* @throws Exception * @throws Exception
*/ */
public function __construct(array $options = []) { public function __construct(array $options = []) {
parent::__construct($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(); $this->createHandle();
} }
@ -115,4 +122,14 @@ class LogWriterFile extends LogWriter
return false; return false;
} }
public function getMaxLogFileSize(): int
{
return $this->maxLogFileSize;
}
public function setMaxLogFileSize(int $maxLogFileSize): void
{
$this->maxLogFileSize = $maxLogFileSize;
}
} }