Skip to content

Commit d840cfa

Browse files
committed
improve the logging in getDocument()
1 parent b2b8f81 commit d840cfa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,8 @@ public static Document getDocument(File file) throws ParseException, IOException
21112111
try {
21122112
Statistics stat = new Statistics();
21132113
TopDocs top = searcher.search(q, 1);
2114-
stat.report(LOGGER, Level.FINEST, String.format("search via getDocument(%s) done", file),
2114+
stat.report(LOGGER, Level.FINEST,
2115+
String.format("search via getDocument(%s) done (%d hits)", file, top.totalHits.value),
21152116
"search.latency", new String[]{"category", "getdocument",
21162117
"outcome", top.totalHits.value == 0 ? "empty" : "success"});
21172118
if (top.totalHits.value == 0) {
@@ -2123,6 +2124,7 @@ public static Document getDocument(File file) throws ParseException, IOException
21232124

21242125
// Only use the document if we found an exact match.
21252126
if (!path.equals(foundPath)) {
2127+
LOGGER.log(Level.FINEST, "not matching path: ''{0}''", foundPath);
21262128
return null;
21272129
}
21282130
} finally {

0 commit comments

Comments
 (0)