nfsantos commented on code in PR #1645:
URL: https://github.com/apache/jackrabbit-oak/pull/1645#discussion_r1717085753
##########
oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java:
##########
@@ -300,18 +300,42 @@ protected boolean indexTypeOrderedFields(Document doc,
String pname, int tag, Pr
fieldAdded = true;
} else {
long now = System.currentTimeMillis();
- if (now > lastDuplicateWarning +
DUPLICATE_WARNING_INTERVAL_MS) {
+ if (now > lastOrderedPropertyWarning +
ORDERED_PROPERTY_WARNING_INTERVAL_MS) {
log.warn("Duplicate value for ordered field {};
ignoring. Possibly duplicate index definition.", f.name());
- lastDuplicateWarning = now;
+ lastOrderedPropertyWarning = now;
}
}
}
} catch (Exception e) {
- log.warn(
- "[{}] Ignoring ordered property. Could not convert
property {} of type {} to type {} for path {}",
- getIndexName(), pname,
- Type.fromTag(property.getType().tag(), false),
- Type.fromTag(tag, false), path, e);
+ boolean unknownWarning = true;
+ String message = e.getMessage();
+ if (message.startsWith("Not a date string") ||
+ message.startsWith("Unable to parse the provided date
field") ||
+ message.startsWith("For input string")) {
Review Comment:
I think we should treat each of the messages separately. As it is, this
implementation may totally suppress some classes of warnings. A message like
"Not a date string" might never be shown if it just happens to always occur
when the logging is being suppressed. Maybe we can use this class, which
already does something like what we want:
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/LogSilencer.java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]