Elffuss BraidHub

kikocis/java-driver public

Merge pull request #388 from tommystendahl/java718

Log streamid at the trace level on sending and receiving (JAVA-718)
Changeset743d7237895c4a0559efbeacce7c859754d86e9bda33b56f8550607e0ebb8bec
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2015-07-29 15:49 +02:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2015-07-29 15:49 +02:00
Parents56a63006452d, 00883e9d0d4d

Browse the files at this changeset

2 files changed

modified changelog/README.md +1 −0
@@ -2,6 +2,7 @@
22
33 ### 2.0.11 (in progress)
44
5+- [improvement] Log streamid at the trace level on sending request and receiving response (JAVA-718)
56 - [bug] Fix SpeculativeExecutionPolicy.init() and close() are never called (JAVA-796)
67 - [improvement] Suppress unnecessary warning at shutdown (JAVA-710)
78 - [improvement] Allow DNS name with multiple A-records as contact point (#340)
modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +4 −4
@@ -516,7 +516,7 @@
516516 throw new ConnectionException(address, "Connection has been closed");
517517 }
518518
519- logger.trace("{} writing request {}", this, request);
519+ logger.trace("{}, stream {}, writing request {}", this, request.getStreamId(), request);
520520 writer.incrementAndGet();
521521
522522 if (DISABLE_COALESCING) {
@@ -538,7 +538,7 @@
538538 writer.decrementAndGet();
539539
540540 if (!writeFuture.isSuccess()) {
541- logger.debug("{} Error writing request {}", Connection.this, request);
541+ logger.debug("{}, stream {}, Error writing request {}", Connection.this, request.getStreamId(), request);
542542 // Remove this handler from the dispatcher so it don't get notified of the error
543543 // twice (we will fail that method already)
544544 dispatcher.removeHandler(handler, true);
@@ -562,7 +562,7 @@
562562 }
563563 });
564564 } else {
565- logger.trace("{} request sent successfully", Connection.this);
565+ logger.trace("{}, stream {}, request sent successfully", Connection.this, request.getStreamId());
566566 }
567567 }
568568 };
@@ -955,7 +955,7 @@
955955 int streamId = response.getStreamId();
956956
957957 if(logger.isTraceEnabled())
958- logger.trace("{} received: {}", Connection.this, asDebugString(response));
958+ logger.trace("{}, stream {}, received: {}", Connection.this, streamId, asDebugString(response));
959959
960960 if (streamId < 0) {
961961 factory.defaultHandler.handle(response);