diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java')
-rwxr-xr-x | config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java index 45060f2f27d..28cc787d1b7 100755 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java @@ -26,6 +26,7 @@ import com.yahoo.container.jdisc.state.StateHandler; import com.yahoo.container.logging.AccessLog; import com.yahoo.container.usability.BindingsOverviewHandler; import com.yahoo.document.config.DocumentmanagerConfig; +import com.yahoo.jdisc.http.server.jetty.VoidRequestLog; import com.yahoo.osgi.provider.model.ComponentModel; import com.yahoo.prelude.semantics.SemanticRulesConfig; import com.yahoo.search.config.IndexInfoConfig; @@ -61,6 +62,7 @@ import com.yahoo.vespa.model.container.search.ContainerSearch; import com.yahoo.vespa.model.container.search.searchchain.SearchChains; import com.yahoo.vespa.model.content.Content; import com.yahoo.vespa.model.search.SearchCluster; + import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; @@ -73,6 +75,7 @@ import java.util.Optional; import java.util.Set; import java.util.TreeSet; +import static com.yahoo.vespa.model.container.component.AccessLogComponent.AccessLogType.jsonAccessLog; import static com.yahoo.vespa.model.container.component.chain.ProcessingHandler.PROCESSING_HANDLER_CLASS; /** @@ -148,9 +151,9 @@ public abstract class ContainerCluster<CONTAINER extends Container> private final Set<Path> platformBundles = new TreeSet<>(); // Ensure stable ordering private final ComponentGroup<Component<?, ?>> componentGroup; - private final boolean isHostedVespa; + protected final boolean isHostedVespa; private final boolean zooKeeperLocalhostAffinity; - private final String compressionType; + protected final String compressionType; private final Map<String, String> concreteDocumentTypes = new LinkedHashMap<>(); @@ -180,7 +183,6 @@ public abstract class ContainerCluster<CONTAINER extends Container> componentGroup = new ComponentGroup<>(this, "component"); addCommonVespaBundles(); - addSimpleComponent(AccessLog.class); addComponent(new DefaultThreadpoolProvider(this, defaultPoolNumThreads)); addComponent(defaultHandlerThreadpool); addSimpleComponent(com.yahoo.concurrent.classlock.ClassLocking.class); @@ -287,7 +289,7 @@ public abstract class ContainerCluster<CONTAINER extends Container> return componentGroup.removeComponent(componentId); } - private void addSimpleComponent(Class<?> clazz) { + public void addSimpleComponent(Class<?> clazz) { addSimpleComponent(clazz.getName()); } @@ -593,10 +595,14 @@ public abstract class ContainerCluster<CONTAINER extends Container> if (containerSearch != null) containerSearch.connectSearchClusters(clusterMap); } - public void addDefaultSearchAccessLog() { - // In hosted Vespa with one application container per node we do not use the container name to distinguish log files - Optional<String> clusterName = isHostedVespa ? Optional.empty() : Optional.of(getName()); - addComponent(new AccessLogComponent(this, AccessLogComponent.AccessLogType.jsonAccessLog, compressionType, clusterName, isHostedVespa)); + protected void addAccessLog() { /* No access logging by default */ + if (isHostedVespa) { + addSimpleComponent(AccessLog.class); + // In hosted there is one application container per node, so we do not use the container name to distinguish log files + Optional<String> clusterName = isHostedVespa ? Optional.empty() : Optional.of(getName()); + addComponent(new AccessLogComponent(this, jsonAccessLog, compressionType, clusterName, isHostedVespa)); + } else + addSimpleComponent(VoidRequestLog.class); } @Override |