From e950a085f86f651a10adca2e206dd8135ed12fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 13 Jun 2025 08:22:29 +0200 Subject: [PATCH] Fix casing of ServerProperties.Jetty.Accesslog.FORMAT Closes gh-45884 --- .../boot/autoconfigure/web/ServerProperties.java | 8 ++++---- .../web/embedded/JettyWebServerFactoryCustomizer.java | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 58ee33c3659..e98eb5353cd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -1261,7 +1261,7 @@ public class ServerProperties { /** * Log format. */ - private FORMAT format = FORMAT.NCSA; + private Format format = Format.NCSA; /** * Custom log format, see org.eclipse.jetty.server.CustomRequestLog. If @@ -1302,11 +1302,11 @@ public class ServerProperties { this.enabled = enabled; } - public FORMAT getFormat() { + public Format getFormat() { return this.format; } - public void setFormat(FORMAT format) { + public void setFormat(Format format) { this.format = format; } @@ -1361,7 +1361,7 @@ public class ServerProperties { /** * Log format for Jetty access logs. */ - public enum FORMAT { + public enum Format { /** * NCSA format, as defined in CustomRequestLog#NCSA_FORMAT. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java index 7799bcd817e..9c4e60ff4b0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.RequestLogWriter; import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.autoconfigure.web.ServerProperties.Jetty.Accesslog.Format; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory; @@ -201,7 +202,7 @@ public class JettyWebServerFactoryCustomizer if (properties.getCustomFormat() != null) { return properties.getCustomFormat(); } - if (ServerProperties.Jetty.Accesslog.FORMAT.EXTENDED_NCSA.equals(properties.getFormat())) { + if (Format.EXTENDED_NCSA.equals(properties.getFormat())) { return CustomRequestLog.EXTENDED_NCSA_FORMAT; } return CustomRequestLog.NCSA_FORMAT;