in log4j-changelog/src/main/java/org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java [36:55]
private static Configuration createConfiguration(final Path templateDirectory) {
final Version configurationVersion = Configuration.VERSION_2_3_29;
final Configuration configuration = new Configuration(configurationVersion);
configuration.setDefaultEncoding(CharsetUtils.CHARSET_NAME);
configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
try {
configuration.setTemplateLoader(new FileTemplateLoader(templateDirectory.toFile()));
} catch (final IOException error) {
throw new UncheckedIOException(error);
}
final DefaultObjectWrapperBuilder objectWrapperBuilder =
new DefaultObjectWrapperBuilder(configurationVersion);
objectWrapperBuilder.setExposeFields(true);
final DefaultObjectWrapper objectWrapper = objectWrapperBuilder.build();
configuration.setObjectWrapper(objectWrapper);
configuration.setLogTemplateExceptions(false);
configuration.setWrapUncheckedExceptions(true);
configuration.setFallbackOnNullLoopVariable(false);
return configuration;
}