From c32d831dd610862985c6fea5285afc5962ab64ad Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Fri, 18 Aug 2023 15:02:03 -0400 Subject: [PATCH] Add logging about Spec11 email sending (#2115) --- .../google/registry/reporting/spec11/Spec11EmailUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java index 9d65a2ff2..9bf55a254 100644 --- a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java +++ b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java @@ -90,6 +90,7 @@ public class Spec11EmailUtils { ImmutableSet registrarThreatMatchesSet) { ImmutableMap.Builder failedMatchesBuilder = ImmutableMap.builder(); + int numRegistrarsEmailed = 0; for (RegistrarThreatMatches registrarThreatMatches : registrarThreatMatchesSet) { RegistrarThreatMatches filteredMatches = filterOutNonPublishedMatches(registrarThreatMatches); if (!filteredMatches.threatMatches().isEmpty()) { @@ -97,11 +98,13 @@ public class Spec11EmailUtils { // Handle exceptions individually per registrar so that one failed email doesn't prevent // the rest from being sent. emailRegistrar(date, soyTemplateInfo, subject, filteredMatches); + numRegistrarsEmailed++; } catch (Throwable e) { failedMatchesBuilder.put(registrarThreatMatches, getRootCause(e)); } } } + logger.atInfo().log("Emailed daily diffs to %s registrars.", numRegistrarsEmailed); ImmutableMap failedMatches = failedMatchesBuilder.build(); if (!failedMatches.isEmpty()) { ImmutableList> failedMatchesList =