Skip to content

Commit 723222a

Browse files
committed
Allow configuredLevel to be null when configuring a logger
Null value is used to indicate that the configured level should be cleared. Closes gh-10934
1 parent 4a9186b commit 723222a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.springframework.boot.logging.LogLevel;
3232
import org.springframework.boot.logging.LoggerConfiguration;
3333
import org.springframework.boot.logging.LoggingSystem;
34+
import org.springframework.lang.Nullable;
3435
import org.springframework.util.Assert;
3536

3637
/**
@@ -76,7 +77,8 @@ public LoggerLevels loggerLevels(@Selector String name) {
7677
}
7778

7879
@WriteOperation
79-
public void configureLogLevel(@Selector String name, LogLevel configuredLevel) {
80+
public void configureLogLevel(@Selector String name,
81+
@Nullable LogLevel configuredLevel) {
8082
Assert.notNull(name, "Name must not be empty");
8183
this.loggingSystem.setLogLevel(name, configuredLevel);
8284
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LoggersEndpointWebIntegrationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import net.minidev.json.JSONArray;
2424
import org.junit.After;
2525
import org.junit.Before;
26-
import org.junit.Ignore;
2726
import org.junit.Test;
2827
import org.junit.runner.RunWith;
2928
import org.mockito.Mockito;
@@ -54,7 +53,6 @@
5453
* @author Stephane Nicoll
5554
* @author Andy Wilkinson
5655
*/
57-
@Ignore
5856
@RunWith(WebEndpointRunners.class)
5957
public class LoggersEndpointWebIntegrationTests {
6058

0 commit comments

Comments
 (0)