mirror of https://github.com/apache/druid.git
"druid.request.logging.type" should allow "noop" value (#10774)
This commit is contained in:
parent
c7fdf1d685
commit
69b0c6a47b
|
@ -64,6 +64,7 @@ public class QueryableModule implements DruidModule
|
|||
return Collections.singletonList(
|
||||
new SimpleModule("QueryableModule")
|
||||
.registerSubtypes(
|
||||
NoopRequestLoggerProvider.class,
|
||||
EmittingRequestLoggerProvider.class,
|
||||
FileRequestLoggerProvider.class,
|
||||
LoggingRequestLoggerProvider.class,
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.druid.guice.JsonConfigurator;
|
|||
import org.apache.druid.guice.ManageLifecycle;
|
||||
import org.apache.druid.guice.QueryableModule;
|
||||
import org.apache.druid.initialization.Initialization;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -70,6 +71,15 @@ public class LoggingRequestLoggerProviderTest
|
|||
Assert.assertTrue(requestLogger.isSetMDC());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoopConfigParsing()
|
||||
{
|
||||
final Properties properties = new Properties();
|
||||
properties.put(propertyPrefix + ".type", "noop");
|
||||
provider.inject(properties, injector.getInstance(JsonConfigurator.class));
|
||||
Assert.assertThat(provider.get().get().get(), Matchers.instanceOf(NoopRequestLogger.class));
|
||||
}
|
||||
|
||||
private Injector makeInjector()
|
||||
{
|
||||
return Initialization.makeInjectorWithModules(
|
||||
|
|
Loading…
Reference in New Issue