blob: c317b03d406a877adf8664e7b96ba955ec34302b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.component;
import com.yahoo.container.logging.ConnectionLog;
import com.yahoo.container.logging.ConnectionLogConfig;
import com.yahoo.vespa.model.container.ContainerCluster;
public class ConnectionLogComponent extends SimpleComponent implements ConnectionLogConfig.Producer {
private final String logDirectoryName;
private final String clusterName;
private final boolean isHostedVespa;
public ConnectionLogComponent(ContainerCluster<?> cluster, Class<? extends ConnectionLog> cls, String logDirectoryName) {
this(cls, logDirectoryName, cluster.getName(), cluster.isHostedVespa());
}
public ConnectionLogComponent(Class<? extends ConnectionLog> cls, String logDirectoryName, String clusterName, boolean isHostedVespa) {
super(cls.getName());
this.logDirectoryName = logDirectoryName;
this.clusterName = clusterName;
this.isHostedVespa = isHostedVespa;
}
@Override
public void getConfig(ConnectionLogConfig.Builder builder) {
builder.cluster(clusterName);
builder.logDirectoryName(logDirectoryName);
if (isHostedVespa) {
builder.useClusterIdInFileName(false);
}
builder.queueSize(-1);
}
}
|