Skip to content

Commit

Permalink
Improve logs for HTTP event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
mosiac1 authored and losipiuk committed Feb 23, 2022
1 parent b33fccf commit 02fa8b4
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,17 @@ public void onSuccess(StatusResponse result)
result.getStatusCode(), nextDelay.roundTo(TimeUnit.SECONDS));

attemptToSend(request, nextAttempt, nextDelay, queryId);
return;
}
else {
log.error("QueryId = \"%s\", attempt = %d/%d, URL = %s | Ingest server responded with code %d, fatal error",
queryId, attempt + 1, config.getRetryCount() + 1, request.getUri().toString(),
result.getStatusCode());
}
}

log.debug("QueryId = \"%s\", attempt = %d/%d, URL = %s | Query event delivered successfully",
queryId, attempt + 1, config.getRetryCount() + 1, request.getUri().toString());
else {
log.debug("QueryId = \"%s\", attempt = %d/%d, URL = %s | Query event delivered successfully",
queryId, attempt + 1, config.getRetryCount() + 1, request.getUri().toString());
}
}

@Override
Expand All @@ -164,11 +169,11 @@ public void onFailure(Throwable t)
nextDelay.roundTo(TimeUnit.SECONDS));

attemptToSend(request, nextAttempt, nextDelay, queryId);
return;
}

log.error(t, "QueryId = \"%s\", attempt = %d/%d, URL = %s | Error sending HTTP request",
queryId, attempt + 1, config.getRetryCount() + 1, request.getUri().toString());
else {
log.error(t, "QueryId = \"%s\", attempt = %d/%d, URL = %s | Error sending HTTP request",
queryId, attempt + 1, config.getRetryCount() + 1, request.getUri().toString());
}
}
}, executor),
(long) delay.getValue(), delay.getUnit());
Expand Down

0 comments on commit 02fa8b4

Please sign in to comment.