From 2ee55bdd29e36fd1ea3de7a3bded2bbd60c4f3fc Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Thu, 18 Jul 2019 10:23:32 +0200 Subject: [PATCH] ProjectWatch: For invalid filters log only on info level and without stacktrace Users and project owners can configure invalid watch filters. Logging each invalid filter with stacktrace on warning level for each change where the filter may apply is much too noisy in the log. Logging the execption message is enough to know what's wrong with a filter. Signed-off-by: Edwin Kempin Change-Id: I7bd94adb9fc9608134a3b8e1570212250a694bf6 --- .../google/gerrit/server/mail/send/ProjectWatch.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/com/google/gerrit/server/mail/send/ProjectWatch.java b/java/com/google/gerrit/server/mail/send/ProjectWatch.java index 06a2e0d9b9..eb3b831034 100644 --- a/java/com/google/gerrit/server/mail/send/ProjectWatch.java +++ b/java/com/google/gerrit/server/mail/send/ProjectWatch.java @@ -99,9 +99,9 @@ public class ProjectWatch { try { add(matching, state.getNameKey(), nc); } catch (QueryParseException e) { - logger.atWarning().withCause(e).log( - "Project %s has invalid notify %s filter \"%s\"", - state.getName(), nc.getName(), nc.getFilter()); + logger.atInfo().log( + "Project %s has invalid notify %s filter \"%s\": %s", + state.getName(), nc.getName(), nc.getFilter(), e.getMessage()); } } } @@ -232,8 +232,8 @@ public class ProjectWatch { logger.atFine().log("The filter did not match for account %s; skip notification", accountId); } catch (QueryParseException e) { // Ignore broken filter expressions. - logger.atWarning().withCause(e).log( - "Account %s has invalid filter in project watch %s", accountId, key); + logger.atInfo().log( + "Account %s has invalid filter in project watch %s: %s", accountId, key, e.getMessage()); } return false; }