mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #44262 from nextcloud/fix/log-on-invalid-loglevel
fix(Logger): Warn on invalid `loglevel` configuration option
This commit is contained in:
commit
3af954fcc8
1 changed files with 7 additions and 1 deletions
|
|
@ -282,7 +282,13 @@ class Log implements ILogger, IDataLogger {
|
|||
}
|
||||
|
||||
$configLogLevel = $this->config->getValue('loglevel', ILogger::WARN);
|
||||
return min(is_int($configLogLevel) ? $configLogLevel : ILogger::WARN, ILogger::FATAL);
|
||||
if (is_numeric($configLogLevel)) {
|
||||
return min((int)$configLogLevel, ILogger::FATAL);
|
||||
}
|
||||
|
||||
// Invalid configuration, warn the user and fall back to default level of WARN
|
||||
error_log('Nextcloud configuration: "loglevel" is not a valid integer');
|
||||
return ILogger::WARN;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue