@ -23,18 +23,10 @@ import java.util.ArrayList;
import java.util.Collection ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Locale ;
import java.util.Map ;
import java.util.Set ;
import org.eclipse.jetty.server.AbstractConnector ;
import org.eclipse.jetty.server.ConnectionFactory ;
import org.eclipse.jetty.server.Handler ;
import org.eclipse.jetty.server.HttpConfiguration ;
import org.eclipse.jetty.server.NCSARequestLog ;
import org.eclipse.jetty.server.Server ;
import org.eclipse.jetty.server.handler.ContextHandler ;
import org.eclipse.jetty.server.handler.HandlerCollection ;
import org.eclipse.jetty.server.handler.HandlerWrapper ;
import java.util.TimeZone ;
import org.springframework.boot.context.properties.ConfigurationProperties ;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty ;
@ -58,6 +50,7 @@ import org.springframework.util.StringUtils;
* @author Venil Noronha
* @author Aur é lien Leboulanger
* @author Brian Clozel
* @author Olivier Lamy
* /
@ConfigurationProperties ( prefix = "server" , ignoreUnknownFields = true )
public class ServerProperties {
@ -895,6 +888,11 @@ public class ServerProperties {
* /
public static class Jetty {
/ * *
* Access log configuration .
* /
private final Accesslog accesslog = new Accesslog ( ) ;
/ * *
* Maximum size in bytes of the HTTP post or put content .
* /
@ -910,7 +908,9 @@ public class ServerProperties {
* /
private Integer selectors ;
private final Accesslog accesslog = new Accesslog ( ) ;
public Accesslog getAccesslog ( ) {
return this . accesslog ;
}
public int getMaxHttpPostSize ( ) {
return this . maxHttpPostSize ;
@ -936,67 +936,70 @@ public class ServerProperties {
this . selectors = selectors ;
}
public Accesslog getAccesslog ( ) {
return this . accesslog ;
}
/ * *
* Jetty access log properties .
* /
public static class Accesslog {
/ * *
* Enable access log .
* /
private boolean enabled ;
private boolean enabled = false ;
/ * *
* accesslog filename . If no filename , logs will be redirected to System . err
* Log filename . If not specified , logs will be redirected to "System.err" .
* /
private String filename ;
/ * *
* number of days before rotated log files are deleted . Default 31
* Date format to place in log file name .
* /
private int retainDays = 31 ;
private String fileDateFormat ;
/ * *
* append to log .
* Number of days before rotated log files are deleted .
* /
private int retentionPeriod = 31 ; // no days
/ * *
* Append to log .
* /
private boolean append ;
/ * *
* the log file name date format .
* Enable extended NCSA format .
* /
private String filenameDate Format;
private boolean extended Format;
/ * *
* extended NCSA format .
* Timestamp format of the request log .
* /
private boolean extended ;
private String dateFormat = "dd/MMM/yyyy:HH:mm:ss Z" ;
/ * *
* Set the timezon e of the request log .
* Local e of the request log .
* /
private String logTimeZon e;
private Locale local e;
/ * *
* Controls logging of the request cookies .
* Timezone of the request log .
* /
private boolean logCookies ;
private TimeZone timeZone = TimeZone . getTimeZone ( "GMT" ) ;
/ * *
* Controls logging of the request hostname .
* Enable logging of the request cookies .
* /
private boolean log Server ;
private boolean log Cookies ;
/ * *
* Controls logging of request processing ti me.
* Enable logging of the request hostna me.
* /
private boolean log Latency ;
private boolean log Server ;
/ * *
* Set the timestamp format for request log entries in the file . If this is not set , the pre - formated request
* timestamp is used .
* Enable logging of request processing time .
* /
private String logDateFormat ;
private boolean logLatency ;
public boolean isEnabled ( ) {
return this . enabled ;
@ -1014,12 +1017,20 @@ public class ServerProperties {
this . filename = filename ;
}
public int getRetainDays ( ) {
return this . retainDays ;
public String getFileDateFormat ( ) {
return this . fileDateFormat ;
}
public void setFileDateFormat ( String fileDateFormat ) {
this . fileDateFormat = fileDateFormat ;
}
public void setRetainDays ( int retainDays ) {
this . retainDays = retainDays ;
public int getRetentionPeriod ( ) {
return this . retentionPeriod ;
}
public void setRetentionPeriod ( int retentionPeriod ) {
this . retentionPeriod = retentionPeriod ;
}
public boolean isAppend ( ) {
@ -1030,28 +1041,36 @@ public class ServerProperties {
this . append = append ;
}
public String getFilenameDateFormat ( ) {
return this . filenameDateFormat ;
public boolean isExtendedFormat ( ) {
return this . extendedFormat ;
}
public void setExtendedFormat ( boolean extendedFormat ) {
this . extendedFormat = extendedFormat ;
}
public String getDateFormat ( ) {
return this . dateFormat ;
}
public void setFilenameDateFormat ( String filenameDateFormat ) {
this . filenameDateFormat = filenameDateFormat ;
public void set DateFormat( String d ateFormat) {
this . dateFormat = d ateFormat;
}
public boolean isExtended ( ) {
return this . extended ;
public Locale getLocale ( ) {
return this . locale ;
}
public void set Extended( boolean extended ) {
this . extended = extended ;
public void set Locale( Locale locale ) {
this . locale = locale ;
}
public String getLog TimeZone( ) {
return this . logT imeZone;
public TimeZone get TimeZone( ) {
return this . t imeZone;
}
public void set LogTimeZone( String logT imeZone) {
this . logTimeZone = logT imeZone;
public void set TimeZone( TimeZone t imeZone) {
this . timeZone = t imeZone;
}
public boolean isLogCookies ( ) {
@ -1063,28 +1082,20 @@ public class ServerProperties {
}
public boolean isLogServer ( ) {
return logServer;
return this . logServer;
}
public void setLogServer ( boolean logServer ) {
public void setLogServer ( boolean logServer ) {
this . logServer = logServer ;
}
public boolean isLogLatency ( ) {
return logLatency;
return this . logLatency;
}
public void setLogLatency ( boolean logLatency ) {
public void setLogLatency ( boolean logLatency ) {
this . logLatency = logLatency ;
}
public String getLogDateFormat ( ) {
return logDateFormat ;
}
public void setLogDateFormat ( String logDateFormat ) {
this . logDateFormat = logDateFormat ;
}
}
}