Skip to content

Commit b937b37

Browse files
sschepensjakubdyszkiewicz
authored andcommitted
Make some info logs debug
Signed-off-by: Sebastian Schepens <[email protected]>
1 parent 9579c75 commit b937b37

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

cache/src/main/java/io/envoyproxy/controlplane/cache/SimpleCache.java

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ public Watch createWatch(
130130

131131
long watchId = watchCount;
132132

133-
LOGGER.info("open watch {} for {}[{}] from node {} for version {}",
134-
watchId,
135-
request.getTypeUrl(),
136-
String.join(", ", request.getResourceNamesList()),
137-
group,
138-
request.getVersionInfo());
133+
if (LOGGER.isDebugEnabled()) {
134+
LOGGER.debug("open watch {} for {}[{}] from node {} for version {}",
135+
watchId,
136+
request.getTypeUrl(),
137+
String.join(", ", request.getResourceNamesList()),
138+
group,
139+
request.getVersionInfo());
140+
}
139141

140142
status.setWatch(watchId, watch);
141143

@@ -150,12 +152,14 @@ public Watch createWatch(
150152
if (!responded) {
151153
watchCount++;
152154

153-
LOGGER.info("did not respond immediately, leaving open watch {} for {}[{}] from node {} for version {}",
154-
watchCount,
155-
request.getTypeUrl(),
156-
String.join(", ", request.getResourceNamesList()),
157-
group,
158-
request.getVersionInfo());
155+
if (LOGGER.isDebugEnabled()) {
156+
LOGGER.debug("did not respond immediately, leaving open watch {} for {}[{}] from node {} for version {}",
157+
watchCount,
158+
request.getTypeUrl(),
159+
String.join(", ", request.getResourceNamesList()),
160+
group,
161+
request.getVersionInfo());
162+
}
159163

160164
status.setWatch(watchCount, watch);
161165

@@ -216,10 +220,12 @@ public void setSnapshot(T group, Snapshot snapshot) {
216220
String version = snapshot.version(watch.request().getTypeUrl(), watch.request().getResourceNamesList());
217221

218222
if (!watch.request().getVersionInfo().equals(version)) {
219-
LOGGER.info("responding to open watch {}[{}] with new version {}",
220-
id,
221-
String.join(", ", watch.request().getResourceNamesList()),
222-
version);
223+
if (LOGGER.isDebugEnabled()) {
224+
LOGGER.debug("responding to open watch {}[{}] with new version {}",
225+
id,
226+
String.join(", ", watch.request().getResourceNamesList()),
227+
version);
228+
}
223229

224230
respond(watch, snapshot, group);
225231

@@ -283,7 +289,7 @@ private boolean respond(Watch watch, Snapshot snapshot, T group) {
283289

284290
String version = snapshot.version(watch.request().getTypeUrl(), watch.request().getResourceNamesList());
285291

286-
LOGGER.info("responding for {} from node {} at version {} with version {}",
292+
LOGGER.debug("responding for {} from node {} at version {} with version {}",
287293
watch.request().getTypeUrl(),
288294
group,
289295
watch.request().getVersionInfo(),

server/src/main/java/io/envoyproxy/controlplane/server/DiscoveryServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private StreamObserver<DiscoveryRequest> createRequestHandler(
177177
long streamId = streamCount.getAndIncrement();
178178
Executor executor = executorGroup.next();
179179

180-
LOGGER.info("[{}] open stream from {}", streamId, defaultTypeUrl);
180+
LOGGER.debug("[{}] open stream from {}", streamId, defaultTypeUrl);
181181

182182
callbacks.forEach(cb -> cb.onStreamOpen(streamId, defaultTypeUrl));
183183

@@ -239,7 +239,7 @@ public void onNext(DiscoveryRequest request) {
239239
requestTypeUrl = defaultTypeUrl;
240240
}
241241

242-
LOGGER.info("[{}] request {}[{}] with nonce {} from version {}",
242+
LOGGER.debug("[{}] request {}[{}] with nonce {} from version {}",
243243
streamId,
244244
requestTypeUrl,
245245
String.join(", ", request.getResourceNamesList()),
@@ -300,7 +300,7 @@ public void onError(Throwable t) {
300300

301301
@Override
302302
public void onCompleted() {
303-
LOGGER.info("[{}] stream closed", streamId);
303+
LOGGER.debug("[{}] stream closed", streamId);
304304

305305
try {
306306
callbacks.forEach(cb -> cb.onStreamClose(streamId, defaultTypeUrl));
@@ -337,7 +337,7 @@ private void send(Response response, String typeUrl) {
337337
.setNonce(nonce)
338338
.build();
339339

340-
LOGGER.info("[{}] response {} with nonce {} version {}", streamId, typeUrl, nonce, response.version());
340+
LOGGER.debug("[{}] response {} with nonce {} version {}", streamId, typeUrl, nonce, response.version());
341341

342342
callbacks.forEach(cb -> cb.onStreamResponse(streamId, response.request(), discoveryResponse));
343343

0 commit comments

Comments
 (0)