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 <ekempin@google.com> Change-Id: I7bd94adb9fc9608134a3b8e1570212250a694bf6
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user