in src/main/java/software/amazon/event/kafkaconnector/logging/ContextAwareLoggerFactory.java [25:45]
static {
var properties = new Properties();
try {
var resource = ContextAwareLoggerFactory.class.getResource("/git.properties");
if (resource != null) {
try (var stream = resource.openStream()) {
properties.load(stream);
}
}
} catch (NullPointerException | IOException ignore) {
}
context =
new LogContext(
Optional.ofNullable(properties.get("git.commit.id.abbrev"))
.map(
id ->
String.format(
"[@%s%s] ",
id, "true".equals(properties.get("git.dirty")) ? "-dirty" : ""))
.orElse("unknown-git-rev"));
}