in log4j-tools-internal-freemarker-util/src/main/java/org/apache/logging/log4j/tools/internal/freemarker/util/FreeMarkerUtils.java [50:67]
private static Configuration createConfiguration(final Path templateDirectory) {
final Configuration configuration = new Configuration(CONFIGURATION_VERSION);
configuration.setDefaultEncoding(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(CONFIGURATION_VERSION);
objectWrapperBuilder.setExposeFields(true);
final DefaultObjectWrapper objectWrapper = objectWrapperBuilder.build();
configuration.setObjectWrapper(objectWrapper);
configuration.setLogTemplateExceptions(false);
configuration.setWrapUncheckedExceptions(true);
configuration.setFallbackOnNullLoopVariable(false);
return configuration;
}