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
1d95219c
Commit
1d95219c
authored
Oct 25, 2016
by
Matthieu Mouminoux
Committed by
Stephane Nicoll
Oct 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to configure Tomcat's rotatable property
See gh-7225
parent
b37b3f7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+13
-0
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+2
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
1d95219c
...
...
@@ -956,6 +956,7 @@ public class ServerProperties
valve
.
setPrefix
(
this
.
accesslog
.
getPrefix
());
valve
.
setSuffix
(
this
.
accesslog
.
getSuffix
());
valve
.
setRenameOnRotate
(
this
.
accesslog
.
isRenameOnRotate
());
valve
.
setRotatable
(
this
.
accesslog
.
isRotatable
());
factory
.
addEngineValves
(
valve
);
}
...
...
@@ -1005,6 +1006,11 @@ public class ServerProperties
*/
private
boolean
renameOnRotate
;
/**
* Enable access log rotation.
*/
private
boolean
rotatable
=
true
;
public
boolean
isEnabled
()
{
return
this
.
enabled
;
}
...
...
@@ -1053,6 +1059,13 @@ public class ServerProperties
this
.
renameOnRotate
=
renameOnRotate
;
}
public
boolean
isRotatable
()
{
return
this
.
rotatable
;
}
public
void
setRotatable
(
boolean
rotatable
)
{
this
.
rotatable
=
rotatable
;
}
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
1d95219c
...
...
@@ -138,6 +138,7 @@ public class ServerPropertiesTests {
map
.
put
(
"server.tomcat.accesslog.pattern"
,
"%h %t '%r' %s %b"
);
map
.
put
(
"server.tomcat.accesslog.prefix"
,
"foo"
);
map
.
put
(
"server.tomcat.accesslog.rename-on-rotate"
,
"true"
);
map
.
put
(
"server.tomcat.accesslog.rotatable"
,
"false"
);
map
.
put
(
"server.tomcat.accesslog.suffix"
,
"-bar.log"
);
map
.
put
(
"server.tomcat.protocol_header"
,
"X-Forwarded-Protocol"
);
map
.
put
(
"server.tomcat.remote_ip_header"
,
"Remote-Ip"
);
...
...
@@ -148,6 +149,7 @@ public class ServerPropertiesTests {
assertThat
(
tomcat
.
getAccesslog
().
getPattern
()).
isEqualTo
(
"%h %t '%r' %s %b"
);
assertThat
(
tomcat
.
getAccesslog
().
getPrefix
()).
isEqualTo
(
"foo"
);
assertThat
(
tomcat
.
getAccesslog
().
isRenameOnRotate
()).
isTrue
();
assertThat
(
tomcat
.
getAccesslog
().
isRotatable
()).
isFalse
();
assertThat
(
tomcat
.
getAccesslog
().
getSuffix
()).
isEqualTo
(
"-bar.log"
);
assertThat
(
tomcat
.
getRemoteIpHeader
()).
isEqualTo
(
"Remote-Ip"
);
assertThat
(
tomcat
.
getProtocolHeader
()).
isEqualTo
(
"X-Forwarded-Protocol"
);
...
...
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