in log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/MdcSerializerResolver.java [35:46]
static MdcSerializer resolve(String mdcSerializerFullClassName) {
if (mdcSerializerFullClassName == null || mdcSerializerFullClassName.isEmpty()) {
return resolveDefault();
}
try {
Class<?> clazz = Class.forName(mdcSerializerFullClassName);
return (MdcSerializer) clazz.getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException |
InvocationTargetException | RuntimeException e) { //RuntimeException added because of bizarre build issue
throw new IllegalArgumentException("Could not create MdcSerializer " + mdcSerializerFullClassName, e);
}
}