Skip to content

Commit

Permalink
Merge pull request #32424 from nextcloud/backport/32382/stable24
Browse files Browse the repository at this point in the history
[stable24] only log diagnostic events if a treshhold is set
  • Loading branch information
blizzz authored May 16, 2022
2 parents 4efd0cd + 30b0a02 commit ee89136
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,8 @@

/**
* 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,

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Diagnostics/EventLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private function writeLog(IEvent $event) {
$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;
}

Expand Down

0 comments on commit ee89136

Please sign in to comment.