Merge pull request #32382 from nextcloud/event-logger-log-minimum

only log diagnostic events if a treshhold is set
pull/32372/head
Robin Appelman 2022-05-16 09:52:23 +07:00 committed by GitHub
commit e700c3cd33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

@ -1791,7 +1791,7 @@ $CONFIG = [
/**
* Enforce the user theme. This will disable the user theming settings
* This must be a valid ITheme ID.
* This must be a valid ITheme ID.
* E.g. light, dark, highcontrast, dark-highcontrast...
*/
'enforce_theme' => '',
@ -2146,6 +2146,8 @@ $CONFIG = [
/**
* Limit diagnostics event logging to events longer than the configured threshold in ms
*
* when set to 0 no diagnostics events will be logged
*/
'diagnostics.logging.threshold' => 0,

@ -126,7 +126,7 @@ class EventLogger implements IEventLogger {
$timeInMs = round($duration * 1000, 4);
$loggingMinimum = (int)$this->config->getValue('diagnostics.logging.threshold', 0);
if ($loggingMinimum > 0 && $timeInMs < $loggingMinimum) {
if ($loggingMinimum === 0 || $timeInMs < $loggingMinimum) {
return;
}