diff options
author | Robin Appelman <robin@icewind.nl> | 2022-05-13 16:06:47 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-05-16 15:33:49 +0300 |
commit | 30b0a0272b62775e9f23b9d4ba5cee7d9d678a5a (patch) | |
tree | d45b433f101dac534502bfa9e7cae60cb91ab6a2 | |
parent | 686d16a56bca1e798096bc54e782d4566a731409 (diff) |
only log diagnostic events if a treshhold is set
this prevents log spam and it's rare that you actually want to very short events logged anyway
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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; } |