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
76758023
Commit
76758023
authored
Mar 11, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
parents
7d031741
f574213c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
LogFileWebEndpoint.java
...ingframework/boot/actuate/logging/LogFileWebEndpoint.java
+2
-2
LogFileWebEndpointWebIntegrationTests.java
...ctuate/logging/LogFileWebEndpointWebIntegrationTests.java
+10
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LogFileWebEndpoint.java
View file @
76758023
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
@@ -55,7 +55,7 @@ public class LogFileWebEndpoint {
this
(
environment
,
null
);
}
@ReadOperation
@ReadOperation
(
produces
=
"text/plain"
)
public
Resource
logFile
()
{
Resource
logFileResource
=
getLogFileResource
();
if
(
logFileResource
==
null
||
!
logFileResource
.
isReadable
())
{
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LogFileWebEndpointWebIntegrationTests.java
View file @
76758023
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
@@ -31,6 +31,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.env.Environment
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.web.reactive.server.WebTestClient
;
import
org.springframework.util.FileCopyUtils
;
...
...
@@ -71,6 +72,14 @@ public class LogFileWebEndpointWebIntegrationTests {
.
expectBody
(
String
.
class
).
isEqualTo
(
"--TEST--"
);
}
@Test
public
void
getRequestThatAcceptsTextPlainProducesResponseWithLogFile
()
{
TestPropertyValues
.
of
(
"logging.file:"
+
this
.
logFile
.
getAbsolutePath
())
.
applyTo
(
context
);
client
.
get
().
uri
(
"/actuator/logfile"
).
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
()
.
expectStatus
().
isOk
().
expectBody
(
String
.
class
).
isEqualTo
(
"--TEST--"
);
}
@Configuration
static
class
TestConfiguration
{
...
...
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