IndexTs: Fix log formatting
Add missing argument to log formatting, and use Logger's built-in
String formatting.
Change-Id: Ic5d9431b9c349e01cac3eb5c06ac096e63dfd561
diff --git a/src/main/java/com/ericsson/gerrit/plugins/highavailability/autoreindex/IndexTs.java b/src/main/java/com/ericsson/gerrit/plugins/highavailability/autoreindex/IndexTs.java
index 0466409..4c3eafa 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/highavailability/autoreindex/IndexTs.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/highavailability/autoreindex/IndexTs.java
@@ -68,7 +68,7 @@
try {
Files.write(indexTsFile, latestTs.format(formatter).getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
- log.error("Unable to update last timestamp for index " + index, e);
+ log.error("Unable to update last timestamp for index {}", index, e);
}
}
}
@@ -100,7 +100,7 @@
IndexName.CHANGE,
change == null ? LocalDateTime.now() : change.getLastUpdatedOn().toLocalDateTime());
} catch (OrmException e) {
- log.warn("Unable to update the latest TS for change {}", e);
+ log.warn("Unable to update the latest TS for change {}", id, e);
}
}