Skip to content

Commit

Permalink
Improve emitter send data log (aws#343)
Browse files Browse the repository at this point in the history
* Improve the emitter sendData failure log message to include the number of bytes involved and the type of entity that failed to be published.

New log message has format:

Exception while sending segment (SegmentImpl) over UDP for entity CoreApi [1827010d1fe3a482] on segment [no parent segment]. Bytes: 77861

* Improve the emitter sendData failure log message to include the number of bytes involved and the type of entity that failed to be published.

New log message has format:

Exception while sending segment (SegmentImpl) over UDP for entity CoreApi [1827010d1fe3a482] on segment [no parent segment]. Bytes: 77861
  • Loading branch information
Kurru authored Jul 26, 2022
1 parent 7e7d732 commit 6f29232
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ private boolean sendData(byte[] data, Entity entity) {
daemonSocket.send(packet);
} catch (Exception e) {
String segmentName = Optional.ofNullable(entity.getParent()).map(this::nameAndId).orElse("[no parent segment]");
logger.error("Exception while sending segment over UDP for entity " + nameAndId(entity) + " on segment "
+ segmentName, e);
logger.error("Exception while sending segment (" + entity.getClass().getSimpleName() + ") over UDP for entity "
+ nameAndId(entity) + " on segment " + segmentName + ". Bytes: " + data.length, e);
return false;
}
return true;
Expand Down

0 comments on commit 6f29232

Please sign in to comment.