allow to adjust the log level globally

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L.
2026-04-17 15:17:30 +02:00
parent c20bae5a0f
commit 74ec1b6baa
8 changed files with 66 additions and 7 deletions

View File

@@ -253,6 +253,11 @@ class ConfigurationManager
set { $this->set('docker_socket_path', $value); }
}
public string $aioLogLevel {
get => $this->getEnvironmentalVariableOrConfig('AIO_LOG_LEVEL', 'aio_log_level', 'warn');
set { $this->set('aio_log_level', $value); }
}
public string $trustedCacertsDir {
get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_TRUSTED_CACERTS_DIR', 'trusted_cacerts_dir', '');
set { $this->set('trusted_cacerts_dir', $value); }
@@ -1065,6 +1070,9 @@ class ConfigurationManager
'NC_DOMAIN' => $this->domain,
'NC_BASE_DN' => $this->getBaseDN(),
'AIO_TOKEN' => $this->aioToken,
'AIO_LOG_LEVEL' => $this->aioLogLevel,
'COLLABORA_LOG_LEVEL' => $this->getCollaboraLogLevel(),
'ELASTIC_LOG_LEVEL' => $this->getElasticLogLevel(),
'BORGBACKUP_REMOTE_REPO' => $this->borgRemoteRepo,
'BORGBACKUP_MODE' => $this->backupMode,
'AIO_URL' => $this->aioUrl,
@@ -1112,6 +1120,22 @@ class ConfigurationManager
default => $this->getRegisteredSecret($placeholder),
};
}
private function getCollaboraLogLevel() : string {
return match ($this->aioLogLevel) {
'warn' => 'warning',
default => $this->aioLogLevel,
};
}
private function getElasticLogLevel() : string {
return match ($this->aioLogLevel) {
'debug' => 'DEBUG',
'info' => 'INFO',
'error' => 'ERROR',
default => 'WARN',
};
}
private function booleanize(mixed $value) : bool {
return in_array($value, [true, 'true'], true);