can add special handlers

This commit is contained in:
Daniel Seifert 2025-02-06 22:48:48 +01:00
parent f46ab842e5
commit c9deb0f47c
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
2 changed files with 7 additions and 4 deletions

View File

@ -43,7 +43,8 @@ trait OxidLoggerTrait
string $loggerName, string $loggerName,
string $filePath, string $filePath,
int $logLevel = Logger::INFO, int $logLevel = Logger::INFO,
?int $maxFiles = null ?int $maxFiles = null,
array $specialHandlers = []
): void ): void
{ {
if (isset($this->loggers['oxid'])) { if (isset($this->loggers['oxid'])) {
@ -54,7 +55,8 @@ trait OxidLoggerTrait
$loggerName, $loggerName,
$filePath, $filePath,
$logLevel, $logLevel,
$maxFiles $maxFiles,
$specialHandlers
); );
} }

View File

@ -46,11 +46,12 @@ trait LoggerTrait
string $loggerName, string $loggerName,
string $filePath, string $filePath,
int $logLevel = Logger::INFO, int $logLevel = Logger::INFO,
?int $maxFiles = null ?int $maxFiles = null,
array $specialHandlers = [] // see LoggerFactory constants
): void ): void
{ {
$this->loggers[$loggerName] = $this->getLoggerFactory() $this->loggers[$loggerName] = $this->getLoggerFactory()
->getFileLogger($loggerName, $filePath, $logLevel, $maxFiles); ->getFileLogger($loggerName, $filePath, $logLevel, $maxFiles, $specialHandlers);
} }
/** /**