Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ public void send(URI url, byte[] payload) throws InterruptedException {
void runOnce(Map.Entry<BoundedQueue.Key, Payload> item) throws InterruptedException {
Payload payload = item.getValue();
final URI url = baseUri.resolve(payload.url);
logger.log(
Level.INFO, "sending {0} bytes to {1}", new Object[] {payload.bytes.length, url});

HttpRequest.Builder builder =
HttpRequest.newBuilder(url).POST(BodyPublishers.ofByteArray(payload.bytes));
Expand All @@ -147,11 +145,16 @@ void runOnce(Map.Entry<BoundedQueue.Key, Payload> item) throws InterruptedExcept
res.body();

logger.log(
Level.INFO, "response {0}: {1}", new Object[] {res.statusCode(), res.body()});
Level.FINER,
"sending {0} bytes to {1}: {2} {3}",
new Object[] {payload.bytes.length, url, res.statusCode(), res.body()});
Comment on lines +148 to +150

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep failed HTTP responses visible

When the endpoint returns 400 or a 5xx response, this unconditional FINER record is filtered out by the usual INFO logging threshold even though handleResponse immediately drops a 400 payload or retries and eventually drops other non-200 payloads. Telemetry retains only the status counters, not the actionable response body, so server-side rejections become silent while transport failures still log at WARNING; use the reduced level only for successful responses and retain a visible level for non-200 responses.

Useful? React with 👍 / 👎.


handleResponse(res.statusCode(), item);
} catch (IOException ex) {
logger.log(Level.WARNING, "error sending request: {0}", ex.toString());
logger.log(
Level.WARNING,
"error sending {0} bytes to {1}: {2}",
new Object[] {payload.bytes.length, url, ex.toString()});
handleTransportError(item);
} catch (InterruptedException ex) {
// Wouldn't be retried, but will show up as a leftover in a telemetry snapshot.
Expand Down Expand Up @@ -203,7 +206,7 @@ void increaseBackoff() {
void backoff() throws InterruptedException {
if (delay > 0) {
int sleep = (int) (250.0 * delay * (0.5 + rng.nextDouble()));
logger.log(Level.INFO, "backoff={0}, sleeping {1}ms", new Object[] {delay, sleep});
logger.log(Level.FINEST, "backoff={0}, sleeping {1}ms", new Object[] {delay, sleep});
Thread.sleep(sleep);
}
}
Expand Down
Loading