Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
dbf09de2
Commit
dbf09de2
authored
Nov 15, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
5825502c
e87664f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
18 deletions
+78
-18
pom.xml
...g-boot-project/spring-boot-actuator-autoconfigure/pom.xml
+30
-15
ServletManagementChildContextConfiguration.java
...b/servlet/ServletManagementChildContextConfiguration.java
+48
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml
View file @
dbf09de2
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
...
...
@@ -258,6 +259,11 @@
<artifactId>
aspectjweaver
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-server
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.elasticsearch
</groupId>
<artifactId>
elasticsearch
</artifactId>
...
...
@@ -602,20 +608,27 @@
<configuration>
<exportAntProperties>
true
</exportAntProperties>
<target>
<taskdef
resource=
"net/sf/antcontrib/antcontrib.properties"
/>
<taskdef
name=
"stringutil"
classname=
"ise.antelope.tasks.StringUtilTask"
/>
<taskdef
resource=
"net/sf/antcontrib/antcontrib.properties"
/>
<taskdef
name=
"stringutil"
classname=
"ise.antelope.tasks.StringUtilTask"
/>
<var
name=
"version-type"
value=
"${project.version}"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
".*\.(.*)"
replace=
"\1"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"(M)\d+"
replace=
"MILESTONE"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"(RC)\d+"
replace=
"MILESTONE"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"BUILD-(.*)"
replace=
"SNAPSHOT"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
".*\.(.*)"
replace=
"\1"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"(M)\d+"
replace=
"MILESTONE"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"(RC)\d+"
replace=
"MILESTONE"
/>
<propertyregex
property=
"version-type"
override=
"true"
input=
"${version-type}"
regexp=
"BUILD-(.*)"
replace=
"SNAPSHOT"
/>
<var
name=
"github-tag"
value=
"v${project.version}"
/>
<propertyregex
property=
"github-tag"
override=
"true"
input=
"${github-tag}"
regexp=
".*SNAPSHOT"
replace=
"master"
/>
<propertyregex
property=
"github-tag"
override=
"true"
input=
"${github-tag}"
regexp=
".*SNAPSHOT"
replace=
"master"
/>
</target>
</configuration>
</execution>
...
...
@@ -629,10 +642,12 @@
<target>
<zip
destfile=
"${project.build.directory}/${project.artifactId}-${project.version}-docs.zip"
>
<zipfileset
dir=
"${project.build.directory}/generated-docs"
<zipfileset
dir=
"${project.build.directory}/generated-docs"
includes=
"index.html"
prefix=
"html"
/>
<mappedresources>
<fileset
dir=
"${project.build.directory}/generated-docs"
<fileset
dir=
"${project.build.directory}/generated-docs"
includes=
"index.pdf"
/>
<globmapper
from=
"index.pdf"
to=
"pdf/spring-boot-actuator-web-api.pdf"
/>
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java
View file @
dbf09de2
...
...
@@ -16,10 +16,15 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
web
.
servlet
;
import
java.io.File
;
import
javax.servlet.Filter
;
import
org.apache.catalina.Valve
;
import
org.apache.catalina.valves.AccessLogValve
;
import
org.eclipse.jetty.server.NCSARequestLog
;
import
org.eclipse.jetty.server.RequestLog
;
import
org.eclipse.jetty.server.Server
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.HierarchicalBeanFactory
;
...
...
@@ -39,6 +44,7 @@ import org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactor
import
org.springframework.boot.autoconfigure.web.embedded.UndertowWebServerFactoryCustomizer
;
import
org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryCustomizer
;
import
org.springframework.boot.autoconfigure.web.servlet.TomcatServletWebServerFactoryCustomizer
;
import
org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
...
...
@@ -48,6 +54,7 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.core.Ordered
;
import
org.springframework.security.config.BeanIds
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
org.springframework.util.StringUtils
;
/**
* {@link ManagementContextConfiguration} for Servlet web endpoint infrastructure when a
...
...
@@ -71,16 +78,22 @@ class ServletManagementChildContextConfiguration {
@Bean
@ConditionalOnClass
(
name
=
"io.undertow.Undertow"
)
public
UndertowAccessLogCustomizer
undertowAccessLogCustomizer
()
{
public
UndertowAccessLogCustomizer
undertow
Management
AccessLogCustomizer
()
{
return
new
UndertowAccessLogCustomizer
();
}
@Bean
@ConditionalOnClass
(
name
=
"org.apache.catalina.valves.AccessLogValve"
)
public
TomcatAccessLogCustomizer
tomcatAccessLogCustomizer
()
{
public
TomcatAccessLogCustomizer
tomcat
Management
AccessLogCustomizer
()
{
return
new
TomcatAccessLogCustomizer
();
}
@Bean
@ConditionalOnClass
(
name
=
"org.eclipse.jetty.server.Server"
)
public
JettyAccessLogCustomizer
jettyManagementAccessLogCustomizer
()
{
return
new
JettyAccessLogCustomizer
();
}
@Configuration
@ConditionalOnClass
({
EnableWebSecurity
.
class
,
Filter
.
class
})
@ConditionalOnBean
(
name
=
BeanIds
.
SPRING_SECURITY_FILTER_CHAIN
,
search
=
SearchStrategy
.
ANCESTORS
)
...
...
@@ -119,8 +132,14 @@ class ServletManagementChildContextConfiguration {
abstract
static
class
AccessLogCustomizer
implements
Ordered
{
private
static
final
String
MANAGEMENT_PREFIX
=
"management_"
;
protected
String
customizePrefix
(
String
prefix
)
{
return
"management_"
+
prefix
;
prefix
=
(
prefix
!=
null
)
?
prefix
:
""
;
if
(
prefix
.
startsWith
(
MANAGEMENT_PREFIX
))
{
return
prefix
;
}
return
MANAGEMENT_PREFIX
+
prefix
;
}
@Override
...
...
@@ -163,4 +182,30 @@ class ServletManagementChildContextConfiguration {
}
static
class
JettyAccessLogCustomizer
extends
AccessLogCustomizer
implements
WebServerFactoryCustomizer
<
JettyServletWebServerFactory
>
{
@Override
public
void
customize
(
JettyServletWebServerFactory
factory
)
{
factory
.
addServerCustomizers
(
this
::
customizeServer
);
}
private
void
customizeServer
(
Server
server
)
{
RequestLog
requestLog
=
server
.
getRequestLog
();
if
(
requestLog
!=
null
&&
requestLog
instanceof
NCSARequestLog
)
{
customizeRequestLog
((
NCSARequestLog
)
requestLog
);
}
}
private
void
customizeRequestLog
(
NCSARequestLog
requestLog
)
{
String
filename
=
requestLog
.
getFilename
();
if
(
StringUtils
.
hasLength
(
filename
))
{
File
file
=
new
File
(
filename
);
file
=
new
File
(
file
.
getParentFile
(),
customizePrefix
(
file
.
getName
()));
requestLog
.
setFilename
(
file
.
getPath
());
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment