diff --git a/lib/Service/LoginClassifier.php b/lib/Service/LoginClassifier.php index 99da4a16..17502ea0 100644 --- a/lib/Service/LoginClassifier.php +++ b/lib/Service/LoginClassifier.php @@ -98,12 +98,12 @@ public function process(string $uid, string $ip) { return; } } catch (ServiceException $ex) { - $this->logger->warning("Could not predict suspiciousness: " . $ex->getMessage()); + $this->logger->debug("Could not predict suspiciousness: " . $ex->getMessage()); // This most likely means there is no trained model yet, so we return early here return; } - $this->logger->warning("Detected a login from a suspicious login. user=$uid ip=$ip strategy=" . $strategy::getTypeName()); + $this->logger->info("Detected a login from a suspicious login. user=$uid ip=$ip strategy=" . $strategy::getTypeName()); $login = $this->persistSuspiciousLogin($uid, $ip); $this->notifyUser($uid, $ip, $login); @@ -152,7 +152,7 @@ private function notifyUser(string $uid, string $ip, SuspiciousLogin $login): vo $lastTwoDays = count($this->mapper->findRecentByUid($uid, $now - 60 * 60 * 24 * 2)); if ($lastTwoDays > 10) { - $this->logger->warning("Suspicious login peak detected: $uid received $lastTwoDays alerts in the last two days"); + $this->logger->info("Suspicious login peak detected: $uid received $lastTwoDays alerts in the last two days"); $login->setNotificationState(NotificationState::NOT_SENT_PEAK_TWO_DAYS); $this->mapper->update($login); return; @@ -160,7 +160,7 @@ private function notifyUser(string $uid, string $ip, SuspiciousLogin $login): vo $lastHour = count($this->mapper->findRecentByUid($uid, $now - 60 * 60)); if ($lastHour > 3) { - $this->logger->warning("Suspicious login peak detected: $uid received $lastHour alerts in the last hour"); + $this->logger->info("Suspicious login peak detected: $uid received $lastHour alerts in the last hour"); $login->setNotificationState(NotificationState::NOT_SENT_PEAK_ONE_HOUR); $this->mapper->update($login); return;