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(
|
return Collections.singletonList(
|
||||||
new SimpleModule("QueryableModule")
|
new SimpleModule("QueryableModule")
|
||||||
.registerSubtypes(
|
.registerSubtypes(
|
||||||
|
NoopRequestLoggerProvider.class,
|
||||||
EmittingRequestLoggerProvider.class,
|
EmittingRequestLoggerProvider.class,
|
||||||
FileRequestLoggerProvider.class,
|
FileRequestLoggerProvider.class,
|
||||||
LoggingRequestLoggerProvider.class,
|
LoggingRequestLoggerProvider.class,
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.druid.guice.JsonConfigurator;
|
||||||
import org.apache.druid.guice.ManageLifecycle;
|
import org.apache.druid.guice.ManageLifecycle;
|
||||||
import org.apache.druid.guice.QueryableModule;
|
import org.apache.druid.guice.QueryableModule;
|
||||||
import org.apache.druid.initialization.Initialization;
|
import org.apache.druid.initialization.Initialization;
|
||||||
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -70,6 +71,15 @@ public class LoggingRequestLoggerProviderTest
|
||||||
Assert.assertTrue(requestLogger.isSetMDC());
|
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()
|
private Injector makeInjector()
|
||||||
{
|
{
|
||||||
return Initialization.makeInjectorWithModules(
|
return Initialization.makeInjectorWithModules(
|
||||||
|
|
Loading…
Reference in New Issue