Add Logger actuator documentation
Add Actuator and Reference documentation for the `/logger` endpoint. This documentation includes information on listing, reading, and modifying the configuration of loggers. Closes gh-7390 See gh-7086
This commit is contained in:
@@ -58,6 +58,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@@ -108,6 +109,23 @@ public class EndpointDocumentation {
|
||||
.andDo(document("partial-logfile"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void singleLogger() throws Exception {
|
||||
this.mockMvc
|
||||
.perform(get("/loggers/org.springframework.boot")
|
||||
.accept(MediaType.APPLICATION_JSON))
|
||||
.andExpect(status().isOk()).andDo(document("single-logger"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setLogger() throws Exception {
|
||||
this.mockMvc
|
||||
.perform(post("/loggers/org.springframework.boot")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content("{\"configuredLevel\": \"DEBUG\"}"))
|
||||
.andExpect(status().isOk()).andDo(document("set-logger"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void endpoints() throws Exception {
|
||||
final File docs = new File("src/main/asciidoc");
|
||||
|
||||
Reference in New Issue
Block a user