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
f916e1a1
Commit
f916e1a1
authored
Aug 19, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document response structure for retrieving a logger group
Closes gh-17909
parent
3bc65f4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
loggers.adoc
...or-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc
+11
-0
LoggersEndpointDocumentationTests.java
.../web/documentation/LoggersEndpointDocumentationTests.java
+7
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc
View file @
f916e1a1
...
...
@@ -72,6 +72,17 @@ include::{snippets}loggers/group/http-response.adoc[]
[[loggers-group-response-structure]]
=== Response Structure
The response contains details of the requested group. The following table describes the
structure of the response:
[cols="3,1,3"]
include::{snippets}loggers/group/response-fields.adoc[]
[[loggers-setting-level]]
== Setting a Log Level
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java
View file @
f916e1a1
...
...
@@ -37,6 +37,7 @@ import org.springframework.context.annotation.Import;
import
org.springframework.http.MediaType
;
import
org.springframework.restdocs.mockmvc.MockMvcRestDocumentation
;
import
org.springframework.restdocs.payload.FieldDescriptor
;
import
org.springframework.restdocs.payload.JsonFieldType
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -62,9 +63,9 @@ class LoggersEndpointDocumentationTests extends MockMvcEndpointDocumentationTest
static
{
groupLevelFields
=
Arrays
.
asList
(
fieldWithPath
(
"configuredLevel"
).
description
(
"Configured level of the logger group"
)
.
type
(
LogLevel
.
class
).
optional
(),
fieldWithPath
(
"members"
).
description
(
"Loggers that are part of this group"
)
.
optional
()
);
fieldWithPath
(
"configuredLevel"
).
description
(
"Configured level of the logger group
, if any.
"
)
.
type
(
JsonFieldType
.
STRING
).
optional
(),
fieldWithPath
(
"members"
).
description
(
"Loggers that are part of this group"
));
}
@MockBean
...
...
@@ -98,8 +99,11 @@ class LoggersEndpointDocumentationTests extends MockMvcEndpointDocumentationTest
@Test
void
loggerGroups
()
throws
Exception
{
this
.
loggerGroups
.
get
(
"test"
).
configureLogLevel
(
LogLevel
.
INFO
,
(
member
,
level
)
->
{
});
this
.
mockMvc
.
perform
(
get
(
"/actuator/loggers/test"
)).
andExpect
(
status
().
isOk
())
.
andDo
(
MockMvcRestDocumentation
.
document
(
"loggers/group"
,
responseFields
(
groupLevelFields
)));
resetLogger
();
}
@Test
...
...
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