fixed both LocalFileConfig and its test

This commit is contained in:
RaymondXu 2020-09-16 11:07:07 -04:00
parent 276da34b6d
commit ca759d1bd2
2 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,8 @@ public class LocalFileConfig
return maxLogItemsLimit;
}
@Config("presto-logs.http-request-log.location")
@ConfigDescription("Directory or file where http request logs are written")
public LocalFileConfig setHttpRequestLogLocation(String httpRequestLogLocation)
{
this.httpRequestLogLocation = httpRequestLogLocation;

View File

@ -25,7 +25,7 @@ public class TestLocalFileConfig
public void testDefaults()
{
ConfigAssertions.assertRecordedDefaults(ConfigAssertions.recordDefaults(LocalFileConfig.class)
.setHttpRequestLogFileNamePattern(null));
.setHttpRequestLogFileNamePattern(null).setHttpRequestLogLocation("var/log/http-request.log"));
}
@Test
@ -33,11 +33,14 @@ public class TestLocalFileConfig
{
Map<String, String> properties = new ImmutableMap.Builder<String, String>()
.put("presto-logs.http-request-log.pattern", "bar")
.put("presto-logs.http-request-log.location", "jar")
.build();
LocalFileConfig expected = new LocalFileConfig()
.setHttpRequestLogFileNamePattern("bar");
expected.setHttpRequestLogLocation("jar");
ConfigAssertions.assertFullMapping(properties, expected);
}
}