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
pull/10941/head
Andy Wilkinson 7 years ago
parent 4a9186b1b5
commit 723222aa95

@ -31,6 +31,7 @@ import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.boot.logging.LogLevel;
import org.springframework.boot.logging.LoggerConfiguration;
import org.springframework.boot.logging.LoggingSystem;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@ -76,7 +77,8 @@ public class LoggersEndpoint {
}
@WriteOperation
public void configureLogLevel(@Selector String name, LogLevel configuredLevel) {
public void configureLogLevel(@Selector String name,
@Nullable LogLevel configuredLevel) {
Assert.notNull(name, "Name must not be empty");
this.loggingSystem.setLogLevel(name, configuredLevel);
}

@ -23,7 +23,6 @@ import java.util.EnumSet;
import net.minidev.json.JSONArray;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@ -54,7 +53,6 @@ import static org.mockito.Mockito.verifyZeroInteractions;
* @author Stephane Nicoll
* @author Andy Wilkinson
*/
@Ignore
@RunWith(WebEndpointRunners.class)
public class LoggersEndpointWebIntegrationTests {

Loading…
Cancel
Save