Merge branch 'main' into 4.0.x

Closes gh-45949
This commit is contained in:
Stéphane Nicoll
2025-06-13 08:33:40 +02:00
2 changed files with 7 additions and 6 deletions

View File

@@ -1268,7 +1268,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
@@ -1309,11 +1309,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;
}
@@ -1368,7 +1368,7 @@ public class ServerProperties {
/**
* Log format for Jetty access logs.
*/
public enum FORMAT {
public enum Format {
/**
* NCSA format, as defined in CustomRequestLog#NCSA_FORMAT.

View File

@@ -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;