diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-05-17 00:41:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 00:41:10 +0300 |
commit | ee89136c9af6b8812b9e206b7a455320ba1c89b2 (patch) | |
tree | 51ada389d05c62a7d39e810f3d386fae06fa9996 | |
parent | 4efd0cdadf3ad0b572ff729d3a1c1b3ebff6d74e (diff) | |
parent | 30b0a0272b62775e9f23b9d4ba5cee7d9d678a5a (diff) |
Merge pull request #32424 from nextcloud/backport/32382/stable24
[stable24] only log diagnostic events if a treshhold is set
-rw-r--r-- | config/config.sample.php | 2 | ||||
-rw-r--r-- | lib/private/Diagnostics/EventLogger.php | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 54d3d46070a..f7b63b1491f 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -2128,6 +2128,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, diff --git a/lib/private/Diagnostics/EventLogger.php b/lib/private/Diagnostics/EventLogger.php index c7b89002ea9..7b9bd9630ab 100644 --- a/lib/private/Diagnostics/EventLogger.php +++ b/lib/private/Diagnostics/EventLogger.php @@ -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; } |