From dfad691d92d55d8b458665ca7b810d4fae2d3089 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 7 Nov 2023 22:17:36 +0300 Subject: Add logging for notifications registrations --- src/main/java/com/juick/www/api/Notifications.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/www/api') diff --git a/src/main/java/com/juick/www/api/Notifications.java b/src/main/java/com/juick/www/api/Notifications.java index df2fb507..c1ee74ab 100644 --- a/src/main/java/com/juick/www/api/Notifications.java +++ b/src/main/java/com/juick/www/api/Notifications.java @@ -135,8 +135,10 @@ public class Notifications { @RequestBody List list) { var userTokens = collectTokens(visitor.getUid()); list.forEach(t -> { + logger.debug("Received new token from {}: type {} token {}", visitor.getName(), t.type(), t.token()); if (userTokens.getTokens().stream().noneMatch(existing -> existing.token().equals(t.token()))) { - userService.addToken(visitor.getUid(), t.type(), t.token()); + var added = userService.addToken(visitor.getUid(), t.type(), t.token()); + logger.debug("Token added: {}", added); } }); return Status.OK; -- cgit v1.2.3