mirror of https://github.com/nextcloud/server
fix(Logger): Warn on invalid `loglevel` configuration option
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
575fb8d7a6
commit
e838aa9514
|
@ -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 New Issue