From 90e43737bbb582810b46bee264e0a2f75f41aff0 Mon Sep 17 00:00:00 2001 From: Marcos Barbero Date: Tue, 19 May 2015 16:18:10 -0300 Subject: [PATCH 1/2] Add support for configuring Undertow's access log via the environment This commit adds support for configuring Undertow's access log via the environment using the following properties: server.undertow.access-log-enabled server.undertow.access-log-pattern server.undertow.access-log-dir See gh-3014 --- .../autoconfigure/web/ServerProperties.java | 43 ++++++++++ .../src/test/resources/application.properties | 2 + ...stractEmbeddedServletContainerFactory.java | 20 +++++ ...TomcatEmbeddedServletContainerFactory.java | 15 +--- ...dertowEmbeddedServletContainerFactory.java | 78 +++++++++++++++++++ 5 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 1a53ea0b0f..25e641ca18 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -56,6 +56,7 @@ import org.springframework.util.StringUtils; * @author Stephane Nicoll * @author Andy Wilkinson * @author Ivan Sopov + * @author Marcos Barbero */ @ConfigurationProperties(prefix = "server", ignoreUnknownFields = false) public class ServerProperties implements EmbeddedServletContainerCustomizer, Ordered { @@ -578,6 +579,21 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord private Boolean directBuffers; + /** + * Format pattern for access logs. + */ + private String accessLogPattern; + + /** + * Enable access log. + */ + private boolean accessLogEnabled = false; + + /** + * Undertow access log directory. If not specified a temporary directory will be used. + */ + private File accessLogDir; + public Integer getBufferSize() { return this.bufferSize; } @@ -618,12 +634,39 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord this.directBuffers = directBuffers; } + public String getAccessLogPattern() { + return accessLogPattern; + } + + public void setAccessLogPattern(String accessLogPattern) { + this.accessLogPattern = accessLogPattern; + } + + public boolean isAccessLogEnabled() { + return accessLogEnabled; + } + + public void setAccessLogEnabled(boolean accessLogEnabled) { + this.accessLogEnabled = accessLogEnabled; + } + + public File getAccessLogDir() { + return accessLogDir; + } + + public void setAccessLogDir(File accessLogDir) { + this.accessLogDir = accessLogDir; + } + void customizeUndertow(UndertowEmbeddedServletContainerFactory factory) { factory.setBufferSize(this.bufferSize); factory.setBuffersPerRegion(this.buffersPerRegion); factory.setIoThreads(this.ioThreads); factory.setWorkerThreads(this.workerThreads); factory.setDirectBuffers(this.directBuffers); + factory.setAccessLogDirectory(this.accessLogDir); + factory.setAccessLogPattern(this.accessLogPattern); + factory.setAccessLogEnabled(this.accessLogEnabled); } } diff --git a/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties b/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties new file mode 100644 index 0000000000..db6751484a --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties @@ -0,0 +1,2 @@ +server.undertow.access-log-enabled=true +server.undertow.access-log-pattern=combined \ No newline at end of file diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java index ecfdfca5d1..1c228fdbd6 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java @@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory; * * @author Phillip Webb * @author Dave Syer + * @author Marcos Barbero */ public abstract class AbstractEmbeddedServletContainerFactory extends AbstractConfigurableEmbeddedServletContainer implements @@ -78,6 +79,25 @@ public abstract class AbstractEmbeddedServletContainerFactory extends return file; } + /** + * Returns the absolute temp dir for given web server. + * @param prefix webserver name + * @return The temp dir for given web server. + */ + protected File createTempDir(String prefix) { + try { + File tempFolder = File.createTempFile(prefix + ".", "." + getPort()); + tempFolder.delete(); + tempFolder.mkdir(); + tempFolder.deleteOnExit(); + return tempFolder; + } + catch (IOException ex) { + throw new EmbeddedServletContainerException( + String.format("Unable to create %s tempdir", prefix), ex); + } + } + private File getExplodedWarFileDocumentRoot() { File file = getCodeSourceArchive(); if (this.logger.isDebugEnabled()) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index fbbfbaed6e..7ac76190d9 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -79,6 +79,7 @@ import org.springframework.util.StringUtils; * @author Brock Mills * @author Stephane Nicoll * @author Andy Wilkinson + * @author Marcos Barbero * @see #setPort(int) * @see #setContextLifecycleListeners(Collection) * @see TomcatEmbeddedServletContainer @@ -382,20 +383,6 @@ public class TomcatEmbeddedServletContainerFactory extends return new TomcatEmbeddedServletContainer(tomcat, getPort() >= 0); } - private File createTempDir(String prefix) { - try { - File tempFolder = File.createTempFile(prefix + ".", "." + getPort()); - tempFolder.delete(); - tempFolder.mkdir(); - tempFolder.deleteOnExit(); - return tempFolder; - } - catch (IOException ex) { - throw new EmbeddedServletContainerException( - "Unable to create Tomcat tempdir", ex); - } - } - @Override public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java index cc578e9f0d..1ee386f98b 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java @@ -19,6 +19,10 @@ package org.springframework.boot.context.embedded.undertow; import io.undertow.Undertow; import io.undertow.Undertow.Builder; import io.undertow.UndertowMessages; +import io.undertow.server.HandlerWrapper; +import io.undertow.server.HttpHandler; +import io.undertow.server.handlers.accesslog.AccessLogHandler; +import io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver; import io.undertow.server.handlers.resource.ClassPathResourceManager; import io.undertow.server.handlers.resource.FileResourceManager; import io.undertow.server.handlers.resource.Resource; @@ -69,8 +73,11 @@ import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; import org.springframework.util.ResourceUtils; +import org.xnio.OptionMap; import org.xnio.Options; import org.xnio.SslClientAuthMode; +import org.xnio.XnioWorker; +import org.xnio.Xnio; /** * {@link EmbeddedServletContainerFactory} that can be used to create @@ -81,6 +88,7 @@ import org.xnio.SslClientAuthMode; * * @author Ivan Sopov * @author Andy Wilkinson + * @author Marcos Barbero * @since 1.2.0 * @see UndertowEmbeddedServletContainer */ @@ -105,6 +113,12 @@ public class UndertowEmbeddedServletContainerFactory extends private Boolean directBuffers; + private File accessLogDirectory; + + private String accessLogPattern; + + private boolean accessLogEnabled = false; + /** * Create a new {@link UndertowEmbeddedServletContainerFactory} instance. */ @@ -337,6 +351,9 @@ public class UndertowEmbeddedServletContainerFactory extends for (UndertowDeploymentInfoCustomizer customizer : this.deploymentInfoCustomizers) { customizer.customize(deployment); } + if (isAccessLogEnabled()) { + configureAccessLog(deployment); + } DeploymentManager manager = Servlets.defaultContainer().addDeployment(deployment); manager.deploy(); SessionManager sessionManager = manager.getDeployment().getSessionManager(); @@ -345,6 +362,51 @@ public class UndertowEmbeddedServletContainerFactory extends return manager; } + private void configureAccessLog(DeploymentInfo deploymentInfo) { + deploymentInfo.addInitialHandlerChainWrapper(new HandlerWrapper() { + @Override + public HttpHandler wrap(HttpHandler handler) { + try { + String formatString = (accessLogPattern != null) ? accessLogPattern + : "common"; + DefaultAccessLogReceiver accessLogReceiver = new DefaultAccessLogReceiver( + createWorker(), getLogsDir(), "access_log"); + return new AccessLogHandler(handler, accessLogReceiver, formatString, + Undertow.class.getClassLoader()); + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + } + }); + } + + private XnioWorker createWorker() throws IOException { + Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader()); + OptionMap.Builder builder = OptionMap.builder(); + if(this.ioThreads != null && this.ioThreads > 0) { + builder.set(Options.WORKER_IO_THREADS, ioThreads); + } + if(this.workerThreads != null && this.workerThreads > 0) { + builder.set(Options.WORKER_TASK_CORE_THREADS, workerThreads); + builder.set(Options.WORKER_TASK_MAX_THREADS, workerThreads); + } + return xnio.createWorker(builder.getMap()); + } + + private File getLogsDir() { + File logsDir; + if (accessLogDirectory != null) { + logsDir = accessLogDirectory; + if (!logsDir.isDirectory() && !logsDir.mkdirs()) { + throw new IllegalStateException("Failed to create logs dir '" + logsDir + "'"); + } + } else { + logsDir = createTempDir("undertow"); + } + return logsDir; + } + private void registerServletContainerInitializerToDriveServletContextInitializers( DeploymentInfo deployment, ServletContextInitializer... initializers) { ServletContextInitializer[] mergedInitializers = mergeInitializers(initializers); @@ -442,6 +504,22 @@ public class UndertowEmbeddedServletContainerFactory extends this.directBuffers = directBuffers; } + public void setAccessLogDirectory(File accessLogDirectory) { + this.accessLogDirectory = accessLogDirectory; + } + + public void setAccessLogPattern(String accessLogPattern) { + this.accessLogPattern = accessLogPattern; + } + + public void setAccessLogEnabled(boolean accessLogEnabled) { + this.accessLogEnabled = accessLogEnabled; + } + + public boolean isAccessLogEnabled() { + return accessLogEnabled; + } + /** * Undertow {@link ResourceManager} for JAR resources. */ From 95f31b0d30bfd9845f49abfcde19f9023da1948d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 20 May 2015 10:31:27 +0100 Subject: [PATCH 2/2] Polish Undertow access logs contribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Apply project’s code formatting and conventions - Don’t use the IO and worker thread configuration when creating the worker for the AccessLogReceiver. The IO and worker thread configuration is for HTTP request processing and a worker in its default configuration should be sufficient for the access log receiver. - Don’t use a temporary directory as the default for the access log directory. A temporary directory makes (some) sense for Tomcat as it requires a directory for its basedir. Undertow has no such requirement and using a temporary directory makes it hard to locate the logs. The default has been updated to a directory named logs, created in the current working directory. - Document the new properties in the application properties appendix Closes gh-3014 --- .../autoconfigure/web/ServerProperties.java | 12 ++-- .../appendix-application-properties.adoc | 3 + .../src/main/resources/application.properties | 3 + .../src/test/resources/application.properties | 2 - ...stractEmbeddedServletContainerFactory.java | 20 ------- ...TomcatEmbeddedServletContainerFactory.java | 20 ++++++- ...dertowEmbeddedServletContainerFactory.java | 58 +++++++++---------- 7 files changed, 57 insertions(+), 61 deletions(-) create mode 100644 spring-boot-samples/spring-boot-sample-undertow/src/main/resources/application.properties delete mode 100644 spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 25e641ca18..ca1aa54290 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -582,7 +582,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord /** * Format pattern for access logs. */ - private String accessLogPattern; + private String accessLogPattern = "common"; /** * Enable access log. @@ -590,9 +590,9 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord private boolean accessLogEnabled = false; /** - * Undertow access log directory. If not specified a temporary directory will be used. + * Undertow access log directory. */ - private File accessLogDir; + private File accessLogDir = new File("logs"); public Integer getBufferSize() { return this.bufferSize; @@ -635,7 +635,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord } public String getAccessLogPattern() { - return accessLogPattern; + return this.accessLogPattern; } public void setAccessLogPattern(String accessLogPattern) { @@ -643,7 +643,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord } public boolean isAccessLogEnabled() { - return accessLogEnabled; + return this.accessLogEnabled; } public void setAccessLogEnabled(boolean accessLogEnabled) { @@ -651,7 +651,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord } public File getAccessLogDir() { - return accessLogDir; + return this.accessLogDir; } public void setAccessLogDir(File accessLogDir) { diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 7adf9e5e22..9dbee62505 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -95,6 +95,9 @@ content into your application; rather pick only the properties that you need. server.tomcat.max-http-header-size= # maximum size in bytes of the HTTP message header server.tomcat.max-threads = 0 # number of threads in protocol handler server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding + server.undertow.access-log-enabled=false # if access logging is enabled + server.undertow.access-log-pattern=common # log pattern of the access log + server.undertow.access-log-dir=logs # access logs directory # SPRING MVC ({sc-spring-boot-autoconfigure}/web/WebMvcProperties.{sc-ext}[WebMvcProperties]) spring.mvc.locale= # set fixed locale, e.g. en_UK diff --git a/spring-boot-samples/spring-boot-sample-undertow/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-undertow/src/main/resources/application.properties new file mode 100644 index 0000000000..9d5b25a84a --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-undertow/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.undertow.access-log-enabled=true +server.undertow.access-log-dir=target/logs +server.undertow.access-log-pattern=combined \ No newline at end of file diff --git a/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties b/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties deleted file mode 100644 index db6751484a..0000000000 --- a/spring-boot-samples/spring-boot-sample-undertow/src/test/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -server.undertow.access-log-enabled=true -server.undertow.access-log-pattern=combined \ No newline at end of file diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java index 1c228fdbd6..ecfdfca5d1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java @@ -32,7 +32,6 @@ import org.apache.commons.logging.LogFactory; * * @author Phillip Webb * @author Dave Syer - * @author Marcos Barbero */ public abstract class AbstractEmbeddedServletContainerFactory extends AbstractConfigurableEmbeddedServletContainer implements @@ -79,25 +78,6 @@ public abstract class AbstractEmbeddedServletContainerFactory extends return file; } - /** - * Returns the absolute temp dir for given web server. - * @param prefix webserver name - * @return The temp dir for given web server. - */ - protected File createTempDir(String prefix) { - try { - File tempFolder = File.createTempFile(prefix + ".", "." + getPort()); - tempFolder.delete(); - tempFolder.mkdir(); - tempFolder.deleteOnExit(); - return tempFolder; - } - catch (IOException ex) { - throw new EmbeddedServletContainerException( - String.format("Unable to create %s tempdir", prefix), ex); - } - } - private File getExplodedWarFileDocumentRoot() { File file = getCodeSourceArchive(); if (this.logger.isDebugEnabled()) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index 7ac76190d9..0f82e38245 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -79,7 +79,6 @@ import org.springframework.util.StringUtils; * @author Brock Mills * @author Stephane Nicoll * @author Andy Wilkinson - * @author Marcos Barbero * @see #setPort(int) * @see #setContextLifecycleListeners(Collection) * @see TomcatEmbeddedServletContainer @@ -388,6 +387,25 @@ public class TomcatEmbeddedServletContainerFactory extends this.resourceLoader = resourceLoader; } + /** + * Returns the absolute temp dir for given web server. + * @param prefix webserver name + * @return The temp dir for given web server. + */ + protected File createTempDir(String prefix) { + try { + File tempFolder = File.createTempFile(prefix + ".", "." + getPort()); + tempFolder.delete(); + tempFolder.mkdir(); + tempFolder.deleteOnExit(); + return tempFolder; + } + catch (IOException ex) { + throw new EmbeddedServletContainerException( + "Unable to create Tomcat tempdir", ex); + } + } + /** * Set the Tomcat base directory. If not specified a temporary directory will be used. * @param baseDirectory the tomcat base directory diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java index 1ee386f98b..c35b60835f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java @@ -22,6 +22,7 @@ import io.undertow.UndertowMessages; import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.handlers.accesslog.AccessLogHandler; +import io.undertow.server.handlers.accesslog.AccessLogReceiver; import io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver; import io.undertow.server.handlers.resource.ClassPathResourceManager; import io.undertow.server.handlers.resource.FileResourceManager; @@ -76,8 +77,8 @@ import org.springframework.util.ResourceUtils; import org.xnio.OptionMap; import org.xnio.Options; import org.xnio.SslClientAuthMode; -import org.xnio.XnioWorker; import org.xnio.Xnio; +import org.xnio.XnioWorker; /** * {@link EmbeddedServletContainerFactory} that can be used to create @@ -366,45 +367,38 @@ public class UndertowEmbeddedServletContainerFactory extends deploymentInfo.addInitialHandlerChainWrapper(new HandlerWrapper() { @Override public HttpHandler wrap(HttpHandler handler) { - try { - String formatString = (accessLogPattern != null) ? accessLogPattern - : "common"; - DefaultAccessLogReceiver accessLogReceiver = new DefaultAccessLogReceiver( - createWorker(), getLogsDir(), "access_log"); - return new AccessLogHandler(handler, accessLogReceiver, formatString, - Undertow.class.getClassLoader()); - } - catch (IOException ex) { - throw new IllegalStateException(ex); - } + return createAccessLogHandler(handler); } }); } - private XnioWorker createWorker() throws IOException { - Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader()); - OptionMap.Builder builder = OptionMap.builder(); - if(this.ioThreads != null && this.ioThreads > 0) { - builder.set(Options.WORKER_IO_THREADS, ioThreads); + private AccessLogHandler createAccessLogHandler(HttpHandler handler) { + try { + createAccessLogDirectoryIfNecessary(); + AccessLogReceiver accessLogReceiver = new DefaultAccessLogReceiver( + createWorker(), this.accessLogDirectory, "access_log"); + String formatString = (this.accessLogPattern != null) ? this.accessLogPattern + : "common"; + return new AccessLogHandler(handler, accessLogReceiver, formatString, + Undertow.class.getClassLoader()); } - if(this.workerThreads != null && this.workerThreads > 0) { - builder.set(Options.WORKER_TASK_CORE_THREADS, workerThreads); - builder.set(Options.WORKER_TASK_MAX_THREADS, workerThreads); + catch (IOException ex) { + throw new IllegalStateException("Failed to create AccessLogHandler", ex); } - return xnio.createWorker(builder.getMap()); } - private File getLogsDir() { - File logsDir; - if (accessLogDirectory != null) { - logsDir = accessLogDirectory; - if (!logsDir.isDirectory() && !logsDir.mkdirs()) { - throw new IllegalStateException("Failed to create logs dir '" + logsDir + "'"); - } - } else { - logsDir = createTempDir("undertow"); + private void createAccessLogDirectoryIfNecessary() { + Assert.notNull(this.accessLogDirectory, "accesslogDirectory must not be null"); + if (!this.accessLogDirectory.isDirectory() && !this.accessLogDirectory.mkdirs()) { + throw new IllegalStateException("Failed to create access log directory '" + + this.accessLogDirectory + "'"); } - return logsDir; + } + + private XnioWorker createWorker() throws IOException { + Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader()); + OptionMap.Builder builder = OptionMap.builder(); + return xnio.createWorker(builder.getMap()); } private void registerServletContainerInitializerToDriveServletContextInitializers( @@ -517,7 +511,7 @@ public class UndertowEmbeddedServletContainerFactory extends } public boolean isAccessLogEnabled() { - return accessLogEnabled; + return this.accessLogEnabled; } /**